Hi, How can I go about creating a macro to delete all text that isn't highlighted? Thanks, Adrian
D DocA Dec 5, 2003 #1 Hi, How can I go about creating a macro to delete all text that isn't highlighted? Thanks, Adrian
D DocA Dec 9, 2003 #4 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
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