Create selected checkbox in MS word document

I would like to add a selected checkbox in a word document .I have tried using the Dynamic Word Document smart service to add a checkbox but it didn't work out .

Also using the MS word template smart service I found out a way to add a checkbox using the code below:

"<w:p>
<w:pPr>
<w:pStyle w:val=""NoSpacing""/>
<w:spacing w:before=""40"" w:after=""40""/>
<w:jc w:val=""center""/>
<w:rPr>
<w:rFonts w:ascii=""Arial"" w:hAnsi=""Arial"" w:cs=""Arial""/>
<w:sz w:val=""20""/>
<w:szCs w:val=""20""/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii=""Arial"" w:hAnsi=""Arial"" w:cs=""Arial""/>
<w:sz w:val=""20""/>
<w:szCs w:val=""20""/>
</w:rPr>
<w:fldChar w:fldCharType=""begin"">
<w:ffData>
<w:name w:val=""""/>
<w:enabled/>
<w:calcOnExit w:val=""0""/>
<w:checkBox>
<w:sizeAuto/>
<w:default w:val="&char(34)&if(true(),"1","0")&char(34)&"/>
</w:checkBox>
</w:ffData>
</w:fldChar>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii=""Arial"" w:hAnsi=""Arial"" w:cs=""Arial""/>
<w:sz w:val=""20""/>
<w:szCs w:val=""20""/>
</w:rPr>
<w:instrText xml:space=""preserve""> FORMCHECKBOX </w:instrText>
</w:r>

</w:p>"

 

But this code does not create a checkbox in word all the time.( I get an error saying  error at line 0 column 0   word/document.xml)

Has anybody else tried and was able to add a selected checkbox in word document?

attached sample word document.

 

 

testDocumentCheckbox.docx

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data