View Single Post
 
Old 10-06-2012, 11:04 PM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Yes, ya're right, macropod.

Before I asked, I'd forgotten one thing. I just used the Format option in the Find And Replace box without specifying the use of wildcards (?) and ended up with

a block of words (with the formatting) turning out to be just a single underscore and

that's why I came here and asked. Now just put ? in the Find What area and Replace all and it does what I have wanted.

And even before I used such a simple Find/Replace function, I'd written a macro:

Code:
Sub test()

With ActiveDocument.Range.Find
    .ClearFormatting
    .ClearHitHighlight
    .MatchWildcards = True
    .Forward = True
    .Wrap = wdFindContinue
    .Font.ColorIndex = wdRed
    .Execute FindText:="?", Format:=True, ReplaceWith:="_", Replace:=wdReplaceAll
End With

End Sub
But of course, it does not accurately deal with the length of different characters as you said.

Thank you for the references given.
Reply With Quote