View Single Post
 
Old 11-10-2015, 10:41 AM
MacroWizard MacroWizard is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Nov 2015
Posts: 2
MacroWizard is on a distinguished road
Default Loop through controls, make certain controls invisible

New challenge guys,


I can't seem to make any of my controls invisible programmatically. I am using the following code, which works to identify the controls and successfully loops through the controls; however, I can't seem to find the ".visible" property. Any help?

Code:
Sub ParticipantGuide()
Dim ctl As ContentControl
For Each ctl In ActiveDocument.ContentControls
  If ctl.Type = wdContentControlRichText Then
    If ctl.Tag = "FacilitatorBlock" Then
      ctl.Visible = False
      Else
      ' DO NOTHING
      End If
  End If
Next
End Sub
I may be missing something, overlooking something. Hopefully someone here can help.

Thanks in advance for the creative notions.

p.s. I am not set on using these controls. If I need to change to something else, I can do that. Also, the controls are on the document itself, not on a form.
Reply With Quote