I have a VBA code in word that iterates through two arrays of strings, finds the text in the document from one array, and replaces it with the corresponding string in the other array like so:
with application.activedocument.content.find
for i=1 to 100
.text=array1(i)
.replacement.text=array2(i)
.forward=true
.matchcase=true
.wrap=wdFindContinue
.matchwholeword=true
.matchwildcards=false
.matchallwordforms=false
.matchprefix=true
.matchsuffic=true
.matchsoundslike=false
.execute replace:=wdReplaceAll
next
end with
This replaces all the cases indiscriminately. Is there a way to include an if clause that makes it so it won't replace a word if it is the first word in a line? I'm not sure what the vba code for testing if something is the first word of a line.
Any help would be appreciated.