PDA

View Full Version : Solved: Automating Mail Merge: Input required



DonCard
08-31-2004, 12:37 PM
I tried the 'Automating Mail Merge' on a mail merge document as instructed from the VBA Knowledgebase. It did run but not quite automatically. Upon opening the document, an SQL dialogue box concerning the data file comes up and requires input before the merge can begin.

I have tried to create a macro to automate the opening, merging and saving of a series of documents in one fell swoop. The aforementioned dialog box never comes up, but then the macro always hangs up just after the mailmerge command.

Is there anyway to bypass the required input or deal with in in the macro itself?

JOrzech
08-31-2004, 02:38 PM
It sounds like you're running your mail merge against a query that has an expression in it. Is this true?

DonCard
09-01-2004, 07:06 AM
The data for the main merge doc is in the form of a .txt file with semicolons separating the fields; there is only one data set per file so only one merged document is created. This works fine except for the darn dialogue box.

This is the text of the dialogue box:

"Opening this document will run the following SQL Command:
SELECT*FROM C:\Documents and Settings\.......\MailForm1.txt
Data from your database will be placed in the document. Do you want to continue?
Yes/No"

JOrzech
09-01-2004, 02:09 PM
Have you checked this KB?

http://support.microsoft.com/?kbid=825765

DonCard
09-02-2004, 07:32 AM
Thank you Joanne. The KB did the trick. Without the SQL alert, my macro opens, merges, edits and saves a series of documents without input other than starting the macro.

Anne Troy
09-02-2004, 07:39 AM
Hi, Don, JO. Do we need to mark our KB entry, do you think? I mean...will others have the same problem or is it just Don's issue?

I'll mark this solved meanwhile. :)

JOrzech
09-02-2004, 07:40 AM
Hi Dreamboat!:hi:

I think a KB article would be good for us... I'm sure it's not just this one isolated instance (or they wouldn't have a KB on MS I think :)


Glad to have helped Don!