Mail Merge Automation Word 2003

H

Haim

I have an vb.net winform application which saves documents to an sql
database. The application copies the document field to a file,
automates word to open the file, and catches the close event to save the
document to the database.

The app works fine with a word xp or 2000 client. If the document is a
mail merge and the client is word 2003, however, the document opens
without the data list and opens as a plain document (not a mail merge).
If I close the file and open the cached file from the disk, I get a
dialog box informing that word is going to run an sql statement is it
ok. If I say yes the doucment opens as a mail merge witht he proper
records.

How can I get word to open the document from the automation without
killing the mail merge?

Haim
 
L

Lori Turner [MSFT]

Hi Haim,

What you're running into is the SQL Security check that was implemented in
Word 2003 (and also in Word 2002 with SP3). The only way to bypass the
dialog (or open the document at runtime) is to implement a registry key as
outlined in the following article:

825765 - "Opening This Will Run the Following SQL Command" Message When You
Open a Word Document
http://support.microsoft.com/?id=825765

Regards,
Lori Turner
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
H

Haim

Dear Lori,

Thank you very much for the assistance. This was a particularly
annoying problem.

Haim
 

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