Re: Mailmerge to Word - How to suppress message...
From: Dave Jones (anonymous_at_discussions.microsoft.com)
Date: 03/04/04
- Next message: mikepage5: "You Rock"
- Previous message: Ted Allen: "Image Link Still Not Work"
- In reply to: Linda: "Mailmerge to Word - How to suppress message..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Mar 2004 10:10:08 -0800
The problem arises because you are trying to close the
instance of word before printing has finished (You have to
remember that there may be other jobs in the print queue
before the one from your users). I don't think you can
surpress the message as such but I use the following:
While objWord.BackgroundPrintingStatus <> 0
DoEvents
Wend
This needs to be inserted before the objWord.Quit
statement.
What happens is that until printing has finished, word
remains open so the error message is not displayed. The
downside is that the code does not continue until
BackgroundPrintingStatus becomes zero (i.e. the print job
has finished).
I have used this sucessfully with some very large print
jobs where the user is printing upto seventy individual
letters in one go.
hth
Dave
>-----Original Message-----
>I have written the following routine that performs a
>mailmerge to word. This works fine execpt that my users
>are always getting the following error message:
>
>"Word is currently printing. Quitting Word will Cancel all
>Print Jobs. Do you want to Quit Word?".
>
>Is there any way to supress this message? - TIA.
>
> Set objWord = CreateObject("Word.Application")
>
> DoCmd.Hourglass True
> Echo True, "Printing Memorandum...."
> objWord.Documents.Open
>("C:\temp\outstandingbill2.doc")
> objWord.Application.Visible = False
> XOriginalPrinter = objWord.Application.ActivePrinter
> objWord.Application.ActivePrinter = "\\SERVER01
>\PRINT01"
> objWord.ActiveDocument.PrintOut
> objWord.Application.ActivePrinter = XOriginalPrinter
> objWord.ActiveDocument.Saved = True
> objWord.Quit
> Set objWord = Nothing
> DoCmd.Hourglass False
>
>.
>
- Next message: mikepage5: "You Rock"
- Previous message: Ted Allen: "Image Link Still Not Work"
- In reply to: Linda: "Mailmerge to Word - How to suppress message..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|