Inserting "If" statement in Word Macro - TechRepublic
General discussion
February 14, 2002 at 10:52 PM
cas

Inserting “If” statement in Word Macro

by cas . Updated 24 years, 4 months ago

What’s the syntax to insert the indicated “if”?

Selection.Find.ClearFormatting
With Selection.Find
.Text = “^p^pSupplies, Equipment”
other parm’s here…….
End With
Selection.Find.Execute
>>>>>>If the above is “found” do:
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=8, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
>>>>>>EndIf

Thanks

This discussion is locked

All Comments