Hello
I am trying to open an MS Word document from an ASP page then use search and replace to modify the letter (e.g. name and address). I want to do this because of the control over the look and feel of the final letter.
The code I am attempting is:
Code:
set letter = CreateObject("Word.Application")
letter.Documents.Open("letter.doc")
letter.Documents(1).Content.Select
with letter.Documents(1).Selection.find
.Clearformatting
.Forward = true
.Wrap = wdWrapContinue
.Execute FindText:=strFind, Replace:=wdReplaceAll, ReplaceWith:=strReplace
end with
When I execute it I get an 'Expected Statement' error and the debugger is pointing at strFind.
What am I doing wrong?
Regards
James