J
jerem
I'm trying to take this code and alter it - instead of replacing text with
text, I want to replace the text everywhere it appears in the document with
an AutoText entry so I want to substitute the "hello" part of the ReplaceWith
statement below with the AutoText entry [A]:
Set myRange = ActiveDocument.Content
myRange.Find.Execute FindText:="[A]", _
ReplaceWith:="hello", Replace:=wdReplaceAll
I've tried to place in the ReplaceWith:="hello", Replace:=wdReplaceAll area
the following:
ReplaceWith:=wdFieldEmpty, Text:= _
"AUTOTEXT [A] ", PreserveFormatting:=False, _
Replace:=wdReplaceAll
but apparently VBA doesn't like my argument - tells me "Named argument not
found.
Any suggestions......
text, I want to replace the text everywhere it appears in the document with
an AutoText entry so I want to substitute the "hello" part of the ReplaceWith
statement below with the AutoText entry [A]:
Set myRange = ActiveDocument.Content
myRange.Find.Execute FindText:="[A]", _
ReplaceWith:="hello", Replace:=wdReplaceAll
I've tried to place in the ReplaceWith:="hello", Replace:=wdReplaceAll area
the following:
ReplaceWith:=wdFieldEmpty, Text:= _
"AUTOTEXT [A] ", PreserveFormatting:=False, _
Replace:=wdReplaceAll
but apparently VBA doesn't like my argument - tells me "Named argument not
found.
Any suggestions......