Consulting

Results 1 to 7 of 7

Thread: Solved: Automating Mail Merge: Input required

  1. #1
    VBAX Regular
    Joined
    Aug 2004
    Posts
    20
    Location

    Question Solved: Automating Mail Merge: Input required

    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?

  2. #2
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    It sounds like you're running your mail merge against a query that has an expression in it. Is this true?
    Joanne

  3. #3
    VBAX Regular
    Joined
    Aug 2004
    Posts
    20
    Location
    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"

  4. #4
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    Have you checked this KB?

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

  5. #5
    VBAX Regular
    Joined
    Aug 2004
    Posts
    20
    Location
    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.

  6. #6
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    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.
    ~Anne Troy

  7. #7
    VBAX Regular JOrzech's Avatar
    Joined
    Jun 2004
    Location
    Upstate New York
    Posts
    83
    Location
    Hi Dreamboat!

    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!
    Joanne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •