J
jball8
I have a find and replace vba script that can replace what I want, but it
does it to all occurrences, and the requirements are to replace all of the
occurrences except the very first one in the document.
The code is:
Sub FindAndReplacewithAcronym()
Selection.Find.ClearFormatting
With ThisDocument.Application.Selection.Find
.Text = "Full name of the item"
.Replacement.Text = "Acronym of the item"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
ThisDocument.Application.Selection.Find.Execute Replace:=wdReplaceAll
End Sub
How can I modify it to do this? Do I have to count the occurrences and then
do something while the count is greater than 1?
does it to all occurrences, and the requirements are to replace all of the
occurrences except the very first one in the document.
The code is:
Sub FindAndReplacewithAcronym()
Selection.Find.ClearFormatting
With ThisDocument.Application.Selection.Find
.Text = "Full name of the item"
.Replacement.Text = "Acronym of the item"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
ThisDocument.Application.Selection.Find.Execute Replace:=wdReplaceAll
End Sub
How can I modify it to do this? Do I have to count the occurrences and then
do something while the count is greater than 1?