Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    New York, New York
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automated Mail Merge from Access (2000)

    I have questions regarding the automation of a Word MailMerge from Access.

    I am working on a project to allow the Case Managers working in a database I built for our Welfare-to-work program to generate routine correspondence easily. These included correspondence with the client, or with HRA, or the client's WEP site, or the clients employer.

    (One point - the letters are always generated one at a time.)

    I operate the merge (no saved datasource because instalations vary...)

    strMergeType comes from the selected template, which then sets the Path, Connection, & SQL variables accordingly

    Select Case strMergeType
    Case "Test Merge Template"
    strPath = "S:KarlIAWMergeTemplatesTestMergeTemplate2.doc "
    strConnection = "QUERY qryMergeTestMerge"
    strSQL = "SELECT * FROM qryMergeTestMerge WHERE PersonID = " & numPersonID
    End Select

    Set objWord = CreateObject("Word.Application")
    objWord.Application.Visible = True
    Set doc = objWord.Documents.Open(strPath)
    doc.MailMerge.OpenDataSource Name:=CurrentDb.Name, LinkToSource:=True, _
    &Connection:=strConnection, SQLStatement:=strSQL
    doc.MailMerge.Execute

    And just getting this far takes a long time - well over a minute, but I have no clue why. How can I make this run faster.

    My other question, which I haven't tackled yet because I want to find out why it is slow first, is how do I then manipulate the new document that I just merged to save it/etc.

    Any help/advice would be greatly appreciated.
    -Karl

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Automated Mail Merge from Access (2000)

    If you're running over a network, I would recommend that you export the data for the merge to a tab delimited text file and then make that file the data source for the mail merge. That will reduce quite a bit of overhead, since you won't have to reprocess the the query or the SQL against it. In fact, even if you aren't running over a network, the text file will be much faster.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Location
    New York, New York
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automated Mail Merge from Access (2000)

    That sounds like a good idea - I am indeed running this over a network. I spent some time last night testing different approaches, and the linking of the merge source sometimes would take over two and a half minutes... I'll give this a try.

    Thank you Charlotte.

    best,
    Karl

Posting Permissions

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