Solved

how to know when word has printed a document

Posted on 2001-06-05
4
162 Views
Last Modified: 2010-04-06
 I have a program that opena word document and then prints it.

 I wish to  know when word has finished printing the document so that I can close it and open another document.

at present I get a error message whrn I try to open the next document.

0
Comment
Question by:KnucklesMT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6157756
listening

GL
Mike
0
 
LVL 4

Expert Comment

by:DMN
ID: 6157770
Try to turn off background printing in word...
0
 
LVL 2

Expert Comment

by:danysz
ID: 6158528
hi

the best way to do it is to use DDE

it have to be like that :

Application used to perform
"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /x /n /dde

DDE Message (if the application is running)
[REM _DDE_Minimize][FileOpen("%1")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]

Application
WinWord

if DDE application is not running
[FileOpen("%1")][FilePrint 0][FileExit 2]

Topic
System

Enjoy

Daniel
0
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 6158866
can also read from the printer spooler

private
 procedure WM_SpoolerStatus(var Msg : TWMSPOOLERSTATUS); message WM_SPOOLERSTATUS;

implementation

procedure TForm1.WM_SpoolerStatus(var Msg : TWMSPOOLERSTATUS);
Begin
   label1.caption:= Format('Spooler status code is: %d',
[ msg.JobStatus ]);
   label2.caption:= Format('Jobs left in spooler: %d', [msg.JobsLeft]);
 End;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question