macro to delete all text that isn't highlighted

D

DocA

Hi,

How can I go about creating a macro to delete all text that isn't
highlighted?

Thanks,

Adrian
 
D

DocA

Sure. It might not be the best way to do it, but it works:

Selection.Find.Highlight = False
With Selection.Find
.Text = "*"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.CorrectHangulEndings = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
 

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