Re: Mailmerge to Word - How to suppress message...

From: Dave Jones (anonymous_at_discussions.microsoft.com)
Date: 03/04/04


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
>
>.
>



Relevant Pages

  • XP Printing Problem
    ... our Win XP Pro workstations the print job is not ... At some point in the job it stops printing ... Sometimes it will give an error message on the last page ... Novell 5 network and all network printers are on their own ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Why Am I getting Cant Print Because of Error Message?
    ... > Did you try printing another document? ... > | tonight where they had a survey for customers to fill out. ... > | phone tech support and chat support where you can just cut right to the ... > | of numbers you sometimes get with an error message. ...
    (microsoft.public.publisher)
  • RE: Problems Printing After XP Upgrade from 98SE
    ... everyone is still printing fine. ... When we are experiencing the problem, local and remote jobs fail in the ... All Windows XP clients that are using the printer experience the same ... workstation, but if I do that, I'll have to create the queue and re-share it ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Printing Area Too Small
    ... Default output will go to the active window, and since that is a very ... When I call it from an external form I do not get the "Printing Area Too ... for using inputbox. ... that is what could be generating the error message. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Printers wont run
    ... remote printer which is shared on a Windows machine. ... You might have to use "Cancel All Jobs" to clear the ... Then "Printer State: stopped, accepting jobs, published." ... I reset everything and tried printing a page w/ABIWord. ...
    (Debian-User)