B
Brenda A. Reid
WordPerfect used to automatically quit the macro when it couldn't find the
search criteria anymore. Can Word do the same thing? Tried to do a loop
but can't get it to work. Here is my code that I want to keep looping until
it can't find anymore occurrences of *#*.
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*#*"
.Forward = True
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="Macrobutton nomacro [Keyboard]"
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Fields.ToggleShowCodes
Tks . . .
search criteria anymore. Can Word do the same thing? Tried to do a loop
but can't get it to work. Here is my code that I want to keep looping until
it can't find anymore occurrences of *#*.
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*#*"
.Forward = True
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="Macrobutton nomacro [Keyboard]"
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Fields.ToggleShowCodes
Tks . . .