Solved

how to know when word has printed a document

Posted on 2001-06-05
4
156 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now