Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jun 2003
    Location
    Durham, North Carolina, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Data Merge with WORD Document (2000)

    I have written a form letter in WORD that uses an Access database query to provide the data. I have saved the form and each time I open it in WORD, I am able to merge data with no additional steps.

    However, if I open the Word document from with in Access using a command button, I am able to open the document, but the link to the database has been lost. I can reestablish it each time, but this not good for the end user.

    The code I am using to open from Access is as follows:

    Dim oApp As Object

    Set oApp = CreateObject("Word.Application")
    oApp.Documents.Open "c:temp1strfname.doc"

    oApp.Visible = True

    Can someone suggest a cure for the problem.

    Thanks for your help.

    Steve

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Data Merge with WORD Document (2000)

    I can't reproduce this in either Access/Word 97 or Access/word 2002; I don't have Access/Word 2000 but I can hardly imagine that it's different. If you select Tools | Mail Merge..., does the Mail Merge Wizard really indicate that there is no data source?

  3. #3
    New Lounger
    Join Date
    Jun 2003
    Location
    Durham, North Carolina, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Data Merge with WORD Document (2000)

    Yes - that is exactly what happens. When the form is opened from Access, the icon for merging is grayed out. I can then go through the "Get Data" process and the merge icon is then active. This only happens when I open the form with Word from Access. When I open the form with Word outside of Access, all is OK.

    Any suggestions?

    Steve

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Data Merge with WORD Document (2000)

    This is really strange, since I have several databases that open a mail merge document in Word from Access; they have been used intensively for years in Access 97, and now in Access 2002 (we skipped Office 2000 where I work), and I have never seen this problem.

    As a workaround, try restoring the mail merge document to a normal document in the first step of the Mail Merge Wizard. Set the data source for the document in code when you open it from Access. In fact, this is what I usually do, since it allows me to assemble the data source dynamically.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Access Data Merge with WORD Document (2000)

    I think this is happening because you are not setting the data source in code - if you set it you should be OK. In point of fact we always save merge documents with no data source, as you can sometimes get confusing prompts to start another instance of Access and other weird behavior. You might find our Merge Tutorial of value, and there is extensive code for doing merges in issue 3-20 of Woody's Access Watch.
    Wendell

Posting Permissions

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