Opening MailMerge doc in Office 2003

K

Kevin McBride

I've run into a curious problem when automating a
document from Office 2003. I've tried this with VB6 and
VB.NET with the same result.

I have a mail merge document, with the data source saved,
and I open the document using something like:

Dim wrdApp as New Word.Application
wrdApp.Open(FileName:="MailMerge.Doc")
wrdApp.Visible = True

When the document is opened, it's opened as a Normal Word
Document, it's no longer a Mail Merge Letter. We use the
wrdDocument.MailMerge.State to return the document type,
and do special processing on Mail Merge docs.

Oddly, if I close Word, and open the document directly,
without automation, it opens as a MailMerge doc. This
only seems to happen with Office 2003, not with Office
2002 or 2000. Any idea's would be greatly appreciated!
 
C

Cindy M -WordMVP-

Hi Kevin,

Unfortunately, I don't have time to follow up on this with
you - I'm leaving in a couple of hours and will be gone for
a couple of weeks. You should probably open a bug-incident
with Microsoft Support on this, but test with a couple of
different types of data sources and data connection
methods, first, just to make sure it's not a problem with
one of them.

Oh, one thing: When you open the main merge doc "by hand"
don't you get prompted about the SQL and do you want to
continue? And are you suppressing Alerts through your
automation code? That would explain what's happening (the
default with this combination is to open the document
without the data source).

You need to set a Registry key to suppress the alert:

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Opti
ons]

"SQLSecurityCheck"=dword:00000000
I've run into a curious problem when automating a
document from Office 2003. I've tried this with VB6 and
VB.NET with the same result.

I have a mail merge document, with the data source saved,
and I open the document using something like:

Dim wrdApp as New Word.Application
wrdApp.Open(FileName:="MailMerge.Doc")
wrdApp.Visible = True

When the document is opened, it's opened as a Normal Word
Document, it's no longer a Mail Merge Letter. We use the
wrdDocument.MailMerge.State to return the document type,
and do special processing on Mail Merge docs.

Oddly, if I close Word, and open the document directly,
without automation, it opens as a MailMerge doc. This
only seems to happen with Office 2003, not with Office
2002 or 2000. Any idea's would be greatly appreciated!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top