Word 2010 "Why" - Microsoft Community
Office / Word / Windows 10 / Office 2010
hello steve
i baffled have aaron lloyd changes aaronicky lloyd, "why" how stop please.
thank time, meaning find challenge, required below script.
sub nickylloyd()
stringreplaced = stringreplaced + "string searched"
each mystoryrange in activedocument.storyranges
mystoryrange.find
.text = "n lloyd"
.replacement.text = "nicky lloyd"
.wrap = wdfindstop
.clearformatting
.replacement.clearformatting
.execute replace:=wdreplaceall
end with
next mystoryrange
end sub
try this. use wildcard search , add "<" before search string indicate "n" must beginning of word.
sub nickylloyd()
dim mystoryrange range
' stringreplaced = stringreplaced + "string searched"
each mystoryrange in activedocument.storyranges
mystoryrange.find
.text = "<n lloyd"
.replacement.text = "nicky lloyd"
.matchwildcards = true
.wrap = wdfindstop
.clearformatting
.replacement.clearformatting
.execute replace:=wdreplaceall
end with
next mystoryrange
end sub
Office / Word / Windows 10 / Office 2010
Comments
Post a Comment