Printing multiple documents w/ Office 2003: command cannot be performed because a dialog box is open

G

Guest

Hi out there,

we are developing software for local government and administration, and
our software uses Microsoft Office, especially Winword, for creating
documents and printing them. However, since more of our customers moved
to Office 2003 they are experiencing serious problems.

The problems occur when we print multiple documents. This happens
frequently in our application. Stacks of three, five, ten or fifteen
different documents might have to be printed at a time. And it seems
the printing jobs are interfering with each other. While in some cases
multiple documents print out fine, in most cases at some point we are
getting an error box from Winword, saying "The command cannot be
performed because a dialog box is open. ..."

This error is "cascading" if our app keeps sending more print jobs to
Winword. The user gets tons of these error boxes.

I do not really know which open dialog box the error message is
speaking of.

The standard way our app used Winword was DDE communication. However,
when this problem turned up I also tried printing the documents with
ShellExecute(), and I tried OLE automation with Winword. It all made no
difference, the problem is the same.

When looking for a solution I only found pointers to add-ins, macros,
or Norton Antivirus. This did not help me. We never used Norton
Antivirus. And also with all add-ins and macros removed, the problem
still persists.

Office 2003 SP2 is installed, but this does not solve the problem.

The problem definitely does not occur with Office 2000. With Office
2000 we can happily print away whole stacks of documents.

One thing I noted was that when I use "background printing" with Office
2000, Word is really printing in the "background" and only showing the
printing process in a small animated printer icon in the status bar.
With Office 2003, even when I switch to "background printing", a dialog
box with a cancel button pops up saying "printing page 1 of 1" and so
on. Could this dialog box be the one in question, which is interfering
with the following print jobs? But how can I get rid of it? Or how can
I get an answer from Winword saying the print job is finished, and it
would be safe to send the next one?

FWIW, the documents we create are in RTF format. Our development system
is CA-Visual Objects.

Any hints and pointers would be very much appreciated.

TIA
Kay-Viktor
 
G

Guest

Hi Jonathan,

thanks for your input. Your article does not describe the problem (my
problem is not about closing Word but about sending more print jobs)
but it was a useful pointer.

Setting the "background" parameter of the "printout" method to "false"
did not change anything. The printout method already returns while Word
is still printing, and the problem persists.

However, checking the "BackgroundPrinting" status did work. The
interesting thing: I still set the "background" parameter of the
"printout" method to "false". Nevertheless, I can check the
"BackgroundPrinting" status afterwards, and use it for preventing more
print jobs until the current one is finished. For the moment, this
solution seems to work. We will do more tests.

I still wonder why this problem turns up at all with Office 2003. It
never occurred with the earlier Office releases.

Thank you for your efforts
Kay-Viktor
 
E

Eric Bartels

Hi Kay-Viktor,

have you found a solution to hide the printer-status dialog ("printing page
1 of ...") when setting the PrintBackground-Property to false?
I found out that when setting the PrintBackground-Property to true this
dialog does not appear. But if you do so you sometime get warning dialogs
that the margins of the document are out of paper size. Which isn't better
that the printer-status-dialog.

Thanks in advance :)
 
G

Guest

Eric,

I do not know why, but it seems that the printer-status dialog appears
in any case, whatever the PrintBackground property is set to. When I
set this property to true, the dialog DOES appear anyway. That's where
my original problem began, see above.

Therefore I never was at the point where you are now. Sorry.

On the other hand, if the document does not fit on the paper size, I
would indeed expect the system to produce a warning, and my customers
would understand that too. Of course, in automated systems it would be
useful if the warning dialog could be suppressed and the calling
application could be notified instead. I do not know if this is
possible.

Kay-Viktor
 
C

Cindy M -WordMVP-

<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.office.developer.automation,microsoft.public.word.application.errors,microsoft.public.word.programming
NNTP-Posting-Host: 142-219.1-85.cust.bluewin.ch 85.1.219.142
Lines: 1
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
Xref: number1.nntp.dca.giganews.com microsoft.public.office.developer.automation:11453 microsoft.public.word.application.errors:104081 microsoft.public.word.programming:15254
I do not know why, but it seems that the printer-status dialog appears
in any case, whatever the PrintBackground property is set to.
FWIW, I've always found this property to be unreliable. I rather prefer
to use
Application.Options.PrintBackground = False

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top