C
Colin Halliday
I have a Word 2003 mail merge main document (form letter) that is linked to
another Word document data source for the mail merge.
If I open this doc using the Word GUI, it first asks me to confirm that I
want to run a query to select the data from the data source file, then it
opens the form letter fine. I can preview the merged records and complete a
merge to a new document.
I have a VB 2006 project (.net framework 2.0) which opens the same form
letter in code like this:
aplWord.Documents.Open(mstrFormLetter)
mstrFormLetter is a string variable that holds the path to the document.
This does open the form letter and displays it in Word, but it is no longer
a mail merge main document. I have to manually link it to the data source
before I can merge. Once I close the doc and open it manually in Word it is
a main document still and asks me to confirm that I want to select the data
from the data source again.
What else do I need to do in my code to open it ready for the mail merge??
Thanks.
another Word document data source for the mail merge.
If I open this doc using the Word GUI, it first asks me to confirm that I
want to run a query to select the data from the data source file, then it
opens the form letter fine. I can preview the merged records and complete a
merge to a new document.
I have a VB 2006 project (.net framework 2.0) which opens the same form
letter in code like this:
aplWord.Documents.Open(mstrFormLetter)
mstrFormLetter is a string variable that holds the path to the document.
This does open the form letter and displays it in Word, but it is no longer
a mail merge main document. I have to manually link it to the data source
before I can merge. Once I close the doc and open it manually in Word it is
a main document still and asks me to confirm that I want to select the data
from the data source again.
What else do I need to do in my code to open it ready for the mail merge??
Thanks.