A
Anonymous
Hello
I am trying to write a macro that will search a document to replace
heshe, hisher and himher with he, she, his, her, him and her
depending on two radio buttons for male and female.
I'm using the code
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "heshe"
.Replacement.Text = "he"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Do I have to repeat the whole code for each option or is there a
method of using an if statement for male and female and a loop for the
3 find.text options
I am trying to write a macro that will search a document to replace
heshe, hisher and himher with he, she, his, her, him and her
depending on two radio buttons for male and female.
I'm using the code
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "heshe"
.Replacement.Text = "he"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Do I have to repeat the whole code for each option or is there a
method of using an if statement for male and female and a loop for the
3 find.text options