jeudi 21 mars 2019

Using Macros to hide/show content in Microsoft word

I've tried using VBA for my issue, but im thinking Macros might be the better approach (just completely unsure of how to use them):

I've gone through a number of tutorials and instructional videos trying to achieve my intended result of simply allowing a checkbox in my form to hide content when selected, or re-show it when being de-selected, but nothing seems to be working.

Currently, I've created a bookmark for the content I want hidden, and try to call his this in VBA with the following statement - which a number of resources indicated as the solution:

Private Sub CheckBox1_Click()
ActiveDocument.Bookmarks("bookmark").Range.Font.Hidden = CheckBox1.Value
End Sub
But despite doing this, selecting the checkbox has no affect on the content.

Is there a simpler way of doing this/can this be done with macros that involves less coding?




Aucun commentaire:

Enregistrer un commentaire