supressing warning when opening a Word Mail Merge document from Access

P

Paul

I'm using the following line of code in Access to open a word document
linked to my database with an ODBC connection that populates some Mail Merge
fields:

Application.FollowHyperlink "C:\PAM\PAM_Mail_Merge\mail_merge1.doc"

However, before the Word document will open, it displays the following
warning message:

"Opening this document will run the following SQL command:
Select * from 'tblMailMerge'
Data from the database will be placed in the document. Do you want
to continue?"

I would like to suppress this warning message, and I have tried using
"DoCmd.SetWarnings False" in the VBA code in Access, but it doesn't work
because the message is coming from Word rather than from Access.

Is there a way to suppress that warning message in Word when you open a mail
merge file?

Thanks in advance,

Paul
 
A

Allen Browne

Depending on your version of Windows, policies, and permissions, you may be
able to suppress this message by telling Access this is a file, i.e. by
adding the file:/// prefix.

More info:
GoHyperlink() - Handle warnings, special characters, errors opening
hyperlinks
at:
http://allenbrowne.com/func-GoHyperlink.html
 
B

Bob Buckland ?:-\)

Hi Paul,

You can modify the registry to bypass the message in Word
http://support.microsoft.com/kb/825765/en-us?FR=1

============
I'm using the following line of code in Access to open a word document
linked to my database with an ODBC connection that populates some Mail Merge
fields:

Application.FollowHyperlink "C:\PAM\PAM_Mail_Merge\mail_merge1.doc"

However, before the Word document will open, it displays the following
warning message:

"Opening this document will run the following SQL command:
Select * from 'tblMailMerge'
Data from the database will be placed in the document. Do you want
to continue?"

I would like to suppress this warning message, and I have tried using
"DoCmd.SetWarnings False" in the VBA code in Access, but it doesn't work
because the message is coming from Word rather than from Access.

Is there a way to suppress that warning message in Word when you open a mail
merge file?

Thanks in advance,

Paul >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
A

Albert D. Kallal

Actually, use my merge sample. it don't give that warning, and you don't
have to change registiry stuff etc.

The sample I have can be found here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....

Thus, each time you build a new form, you can word merge enable it with
great ease.

Make sure you read the instructions from above, and you should eventually
get to the follwoing page
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html


Note that the merge can also use a query, and thus you don't have to merge
just "one" record..

After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).

Give the above a try…
 
P

Paul

Thank you, gentlemen, for your suggestions.

Peter and Bob - Modifying the Registry is not an option because I will be
deploying the front end to about 70 users, and I won't be able to change
their registries, but I appreciate your taking the time to make the
suggestion.

Allen - I installed the GoHyperlink() function you provided, and it opened
the document, but it didn't supress the warning message. The same message
appeared that I get when I us the FollowHyperlink method of the Application
object. However, because of the other advantages you mention in your Web
page to using the function, I'm going to use it.

Albert - I have yet to try your suggestion, but it's next on my list. I know
you said it was super easy, but I'm not an advanced developer, so it might
take me a bit of time to get it working, even with your clear instructions.
I'll let you know how it works out.

Again, my thanks to all for your help with this.

Paul
 

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