M
Michael Teede
I have a small VB application which automates the
generation of a number of Letters based off a shared data
file. The data file is delimited at the field using ','
and at the record with '~' to allow for carriage returns
to be included within the data.
Originally, the application was run in Win98 using Word97,
with the VB application including a refernce to the
Microsoft Word 8.0 Objects library.
When this was migrated to XP using Word2002, with a
reference to the Microsoft Word 10.0 Objects library, an
error occured when we performed the mail merge. For some
reason, the mail merge is not available until we relink
the data source. When we do this, either manually or
automated, the user is prompted to specify the delimiters,
which is not something that will be accepted by the
business area.
QUESTION - How do we suppress the delimiter dialog window
every time we attempt to open a document and perform a
mail merge?
The sample code is as follows:
Static ObjWord as Word.Application
Set objWord = Nothing
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open "C:\temp\test.doc"
objWord.ActiveDocument.MailMerge.OpenDataSource "c:\temp\te
st.txt"
objWord.ActiveDocument.MailMerge.Destination =
wdSendToNewDocument
objWord.ActiveDocument.MailMerge.Execute
....
generation of a number of Letters based off a shared data
file. The data file is delimited at the field using ','
and at the record with '~' to allow for carriage returns
to be included within the data.
Originally, the application was run in Win98 using Word97,
with the VB application including a refernce to the
Microsoft Word 8.0 Objects library.
When this was migrated to XP using Word2002, with a
reference to the Microsoft Word 10.0 Objects library, an
error occured when we performed the mail merge. For some
reason, the mail merge is not available until we relink
the data source. When we do this, either manually or
automated, the user is prompted to specify the delimiters,
which is not something that will be accepted by the
business area.
QUESTION - How do we suppress the delimiter dialog window
every time we attempt to open a document and perform a
mail merge?
The sample code is as follows:
Static ObjWord as Word.Application
Set objWord = Nothing
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open "C:\temp\test.doc"
objWord.ActiveDocument.MailMerge.OpenDataSource "c:\temp\te
st.txt"
objWord.ActiveDocument.MailMerge.Destination =
wdSendToNewDocument
objWord.ActiveDocument.MailMerge.Execute
....