Home |
Search |
Today's Posts |
#1
|
|||
|
|||
[vba] search and format finds
I figured it out. Here's what my final code looks like: Code: -------------------- Sub UnderlineWords() ' Underline all the words in this array Dim WordsToUnderline(10) As String WordsToUnderline(0) = "access" WordsToUnderline(1) = "assignment" For i = 0 To UBound(WordsToUnderline) With Selection.Find .ClearFormatting With .Replacement .ClearFormatting .Font.Underline = wdUnderlineSingle .Text = WordsToUnderline(i) End With .Text = WordsToUnderline(i) .Forward = True .Wrap = wdFindContinue .Format = True .Execute Replace:=wdReplaceAll End With Next End Sub -------------------- -- leaftye |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
different "number format" for the same "level heading" | Microsoft Word Help | |||
Search and Replace not working if I select a Format for Heading St | Microsoft Word Help |