Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail merge & normal.dot (2003 SP3)

    I use access to open Word and write a mail merge file that is then used to print mail merge docs in Publisher. But, after closing Word from within Access, Word wants me to save Normal.dot. The dialog says "This file is in use by another application or user. (Cocs & Settings.....Normal.dot)". There are no other apps using Normal.dot.
    I don't get this when using very similar code elsewhere. Any ideas on how to stop it here?
    Regards,
    Peter

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

    Re: Mail merge & normal.dot (2003 SP3)

    That's not an Access problem, as far as I can see. Do you initiate the mail merge in Publisher from within Access?

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge & normal.dot (2003 SP3)

    Thanks Hans.
    This procedure prints birthday cards and envelopes.
    The publisher doc is already set as a mail merge doc, with the data source - 'BirthdayEnvelopesData.doc'.
    I use Access to do the following:
    1) Prints the form that this code is called from.
    2) Calls a function that sets the object appWd. (Set appWD = CreateObject("Word.Application"))
    3) Build the word table in 'BirthdayEnvelopesData.doc'. Then Access saves and closes that doc.
    4) Opens and prints a Word merge doc for the envelopes. This is already set to the same data source. Then closes that doc.
    5) Opens and prints the resulting Publisher merge docs. Closes the Publisher doc.
    6) Sets appWd and appPub to Nothing.
    I used to have appWd.Quit before setting appWd to Nothing, but Word kept hanging around in the background and had to be closed using task Manager. Without appWd.Quit Word doesn't hang around.
    Any help would be GREATLY appreciated.
    Regards,
    Peter

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

    Re: Mail merge & normal.dot (2003 SP3)

    Make sure that ALL references to Word in your code go back directly or indirectly to appWd. If you have even one reference that doesn't, you'll create an extra instance of Word that you can't control.

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge & normal.dot (2003 SP3)

    All references to Word go through appWd.
    The following code extract probably will provide a clue to someone with more insight than I.
    <pre>With appwd
    .
    .
    .ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges 'closes envelope
    'Close again, because the merge doc is re-opened!!!
    On Error Resume Next
    ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges 'closes mergedata
    On Error GoTo Err_BirthdaysToWord
    End With 'appWD
    </pre>


    This code is quite old, so I can't exactly remember the circumstances, but it does seem to indicate that there is something amiss.
    Regards,
    Peter

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

    Re: Mail merge & normal.dot (2003 SP3)

    Without the context it's not possible to say anything about this code.

  7. #7
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge & normal.dot (2003 SP3)

    Hans, here is the procedure. It's quite long so I had to attach it as a file.
    Attached Files Attached Files
    Regards,
    Peter

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

    Re: Mail merge & normal.dot (2003 SP3)

    What happens if you quit appPub first, then appWd?

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge & normal.dot (2003 SP3)

    I did that, but it was moot as there is an appWd.Quit & Set appWd = Nothing, just after the last Word doc prints, halfway down the code and way before Publisher is closed. the extra Quit and Nothing were put at the end where it would be executed after an error.
    A strange thing happened. I put a 'Stop' just after that part of the code, where the first Quit & Nothing are, and the error dialog box re Normal.dot saving came up there. I got rid of the dialog and tried again.I did nothing to the code, yet that same dialog has failed to come up with several tries of the code! I closed and restarted the Db and still haven't had the error. Obviously Gremlins!
    I am at a complete loss to explain this. It's not as though the error is new, I've been putting up with it for many months, yet now it's gone. I have yet to see if it survives a computer restart though.
    Thanks for you help
    Attached Images Attached Images
    Regards,
    Peter

Posting Permissions

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