By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

More of a Word problem really.. mailmerge

P: n/a
Hi,

I have a document in MS Word, with the mailmerge all set up.. when I
open the document it asks me if I would like to run the query, I must
click yes/ok to apply the mail merge.

I'm trying to open this file from MS-Access using VBA, I can open the
file fine, but I am not presented with the question of running the
query, and it doesn't run it automatically.

(How) can I amend the open command or subsequently allow the query to
run with minimal intervention from the user?

Help is much appreciated,
Chris
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Assuming you have the following in your code:
objWord.MailMerge.OpenDataSource Name:="C:\database.mdb",
LinkToSource:=True, Connection:="TABLE sourcetable", SQLStatement:="SELECT *
FROM [sourcetable]"

Then add this line of code to execute the mail merge process:

objWord.MailMerge.Execute
"Not Me" <no****@zxy.blah.com> wrote in message
news:d9**********@ucsnew1.ncl.ac.uk...
Hi,

I have a document in MS Word, with the mailmerge all set up.. when I open
the document it asks me if I would like to run the query, I must click
yes/ok to apply the mail merge.

I'm trying to open this file from MS-Access using VBA, I can open the file
fine, but I am not presented with the question of running the query, and
it doesn't run it automatically.

(How) can I amend the open command or subsequently allow the query to run
with minimal intervention from the user?

Help is much appreciated,
Chris

Nov 13 '05 #2

P: n/a
Andy Davis wrote:
Assuming you have the following in your code:
objWord.MailMerge.OpenDataSource Name:="C:\database.mdb",
LinkToSource:=True, Connection:="TABLE sourcetable", SQLStatement:="SELECT *
FROM [sourcetable]"

Then add this line of code to execute the mail merge process:

objWord.MailMerge.Execute


Hey,

Thanks for that. What I'm trying to achieve is simply the same result
as if I just double clicked the file to open it, however it looks like
I'm going to have to strip the mail merge data from the word document,
then inject it via VBA using your methods!

Ah well, cheers for the help
Chris

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.