Unhighlight all text in document

N

Naomi

I would like to create a user form that includes a check
box option to unhighlight all text in a word document,
including the headers and footers. I'd appreciate any
suggestions.

Thanks.
 
D

Dave Lett

Hi Naomi

I _suspect_ that you're talking about shading of the fields. If that's the case, then you can create a user form with three option buttons and an OK button. The routine for the OK button _could_ look like the following

Private Sub cmdOk_Click(
Dim iFieldShading As Intege
Select Case Tru
Case Me.optAlway
iFieldShading = wdFieldShadingAlway
Case Me.optNeve
iFieldShading = wdFieldShadingNeve
Case Me.optWhenSelecte
iFieldShading = wdFieldShadingWhenSelecte
End Selec

ActiveWindow.View.FieldShading = iFieldShadin
Me.Hid
Unload M
End Su

If you really do mean "highlighting", then you can run a replace routine, as describe at the Word MVP site
"Using a macro to replace text where ever it appears in a document including Headers, Footers, Textboxes, etc." at
http://word.mvps.org/faqs/macrosvba/findreplaceallwithvbacontent.ht

HTH,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top