Consulting

Results 1 to 6 of 6

Thread: Solved: Macro to Run a Mail Merge

  1. #1
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location

    Solved: Macro to Run a Mail Merge

    Assuming that I have a mail merge file already set up to run with my Access database, how can I run that from my database? Assume file name is c:\My Documents\mymerge.doc

    Thanks!!
    ~Anne Troy

  2. #2
    VBAX Regular ___'s Avatar
    Joined
    Jun 2004
    Posts
    22
    Location
    Create a query in the db containing the data required, then use that query as the data source for your doc. You shouldn't have to run anything from within the db.

    HTH
    Nemo hic adest illius nominis
    ??????????????????
    ??????

  3. #3
    VBAX Regular ___'s Avatar
    Joined
    Jun 2004
    Posts
    22
    Location
    Or did you mean open the .doc?
    Nemo hic adest illius nominis
    ??????????????????
    ??????

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Actually, the user wants to run the mail merge from the DB, not the doc...see? We're assuming that the mail merge is already set up to the appropriate table/query/whatever.
    ~Anne Troy

  5. #5
    VBAX Regular ___'s Avatar
    Joined
    Jun 2004
    Posts
    22
    Location
    To open the .doc from a form in the db, I'd use the Follow Hyperlink method in the Onclick event of a button.
    [vba]
    Application.FollowHyperlink "c:\My Documents\mymerge.doc", , True, True
    [/vba]
    HTH
    Nemo hic adest illius nominis
    ??????????????????
    ??????

  6. #6
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Okay. I've advised the asker to record a macro to run the mail merge, put that code into the Document_Open, and save the doc file.

    Then to create a command button and put that code behind it.

    Thanks!!
    ~Anne Troy

Posting Permissions

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