I have a 50~ page Word document with an ActiveX checkbox on each page. I do not want these to be displayed when I print the document in any form, ie to a printer or PDF.
I have Googled around and found two examples;
Sub ChangeHidden2()
Dim doc As Word.Document
Dim rngSearch As Word.Range
Dim ffld As Word.FormField
Set doc = ActiveDocument
Set ffld = doc.FormFields("check1")
Set rngSearch = ffld.Range.Paragraphs(1).Range
rngSearch.Start = ffld.Range.End
rngSearch.Text = "Good"
End Sub
But this only hides the first checkbox, not all of them, and;
Sub HideFormsChBx()
Dim doc As Word.Document
Dim cBx As Word.FormField
Dim cntrl As Word.CheckBox
Set doc = ActiveDocument
Set cBx = doc.FormFields("Check1")
Set cntrl = doc.FormFields("Check2").CheckBox
If doc.ProtectionType <> wdNoProtection Then _
doc.Unprotect
cBx.Range.Font.Hidden = cntrl.Value
doc.Protect wdAllowOnlyFormFields, True
End Sub
Which just does not seem to work for me (various errors).
ffld
based on that.