Thread: [Solved] Help with a macro
View Single Post
 
Old 02-01-2010, 07:53 AM
Takket Takket is offline Windows XP Office 2000
Novice
 
Join Date: Jan 2010
Posts: 2
Takket is on a distinguished road
Default Help with a macro

I wrote this macro to find all the hidden text in a document, and replace it with nothing (delete it). The problem is, it is doing the EXACT OPPOSITE. It is finding all the NOT hidden text and deleting it. After I run the macro, if I click on "Edit-Replace" it says "Not Hidden" in the find window. It should just say "Hidden." What am I doing wrong?

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Font.Hidden = True
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Reply With Quote