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
Does it have to be a working checkbox, or do you just need to generate checked / unchecked boxes?
This might seem like too much of a hack, but in case you would be OK with "dead" (i.e. not clickable) checkboxes, I have been using the following text strings perfectly for about 4 years now for our generated word documents: (unchecked box) </w:t><w:rPr><w:rFonts w:ascii='Wingdings' w:hAnsi='Wingdings'/><w:sz w:val='24'/><w:szCs w:val='22'/></w:rPr><w:t>o</w:t><w:t> (checked box) </w:t><w:rPr><w:rFonts w:ascii='Wingdings' w:hAnsi='Wingdings'/><w:sz w:val='24'/><w:szCs w:val='22'/></w:rPr><w:t>þ</w:t><w:t> Nevermind the fact that it changes the font to "Wingdings" to accomplish the affect - it looks really good and is sizeable. There might be a way to do this instead more straightforwardly with just Unicode character, but I haven't experimented with that yet. Hint: you can generate them in different sizes by changing the value of the "w:sz" tag. 24 ~ font size 12.
Thanks for your help, I can create a checkbox using the above code. But after I have created the word document , I want to convert the word document into PDF but the checkbox dont get rendered in PDF it displays as ( o OR þ). In word it works fine but not in PDF after converting it.
Hi I tried the above code and in word document it works fine, but I am getting a # values in place of checkboxes in PDF.
Larsen , Please guide me on how to create a base template for DOCX from dynamic template.