Hi All
I have a MS Word OLE Checkbox question - I can not figure out a call to set a true/false value in a checkbox I place in a docx document.
I have googled the internet and all of the results did not help. Most of them use FormFields, which is not recognized in PB 2017. For example, https://bit.ly/2CCdsns
Not only did "FormFields" failed, but also property call such as 'Value', 'Checked', 'Clicked' failed as well.
Please help.
Thank you
CJ
I am not sure how to utilize "ContentControls" in my script for Word OLE (it is not recognized either the way I did it.)
Try first this in a Word Macro to check what kind of fields you have,
MsgBox ActiveDocument.FormFields.Count
MsgBox ActiveDocument.ContentControls.Count
MsgBox ActiveDocument.InlineShapes.Count
If you have a FormField try this at next step:
If ActiveDocument.FormFields.Item("yourfieldname").Type = 71 Then
' 71 = wdFieldFormCheckbox
MsgBox ActiveDocument.FormFields.Item("Test").CheckBox.Value
End If
Use the Word Object Catalog the explore the object model. In my word version I get it using the F2 key in the Makro editor.
I am able to get the Count by using both FormFields.Count AND Bookmarks.Count. The count is correct.
Your script works for me. I was struggling with the syntax. All I needed was that '.CheckBox'.
Thank you so much!!
CJ