Exiting Office application whilst printing in background. 
Author Message
 Exiting Office application whilst printing in background.

Hi,

     I'd like to know whether anyone knows of a way to exit an application
after it's finished printing in the background (rather than immediately as
it would kill the print spooling for large docs).

    I've tried methods such as looping and checking til it finishes (which
works) but takes up 100% CPU utilization and causes a 5 page doc. which
normally takes 5 secs to spool to take forever instead.

    Bascially, I'm trying to write a script which would automatically open a
doc, print then exit the program afterwards. The exiting after it's printing
is the headache as I haven't found much in terms of 'wait or delays' in wsh
or jscript.

    If any one knows of a solution, I'd really appreciate it.

Thanks for your help.

Sam Tran



Sun, 25 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
Hi,

     I'd like to know whether anyone knows of a way to exit an application
after it's finished printing in the background (rather than immediately as
it would kill the print spooling for large docs).

    I've tried methods such as looping and checking til it finishes (which
works) but takes up 100% CPU utilization and causes a 5 page doc. which
normally takes 5 secs to spool to take forever instead.

    Bascially, I'm trying to write a script which would automatically open a
doc, print then exit the program afterwards. The exiting after it's printing
is the headache as I haven't found much in terms of 'wait or delays' in wsh
or jscript.

    If any one knows of a solution, I'd really appreciate it.

Thanks for your help.

Sam Tran



Sun, 25 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
what app are you priting from?
-cap.


Sun, 25 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
Word, Excel, etc.
Quote:

>what app are you priting from?
>-cap.



Sun, 25 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
Here is a way... Set "app.Options.PrintBackground" to false and
"app.ActiveDocument.PrintOut" won't return until completes printing. So you may
simply print step-by-step.

Set app = Wscript.CreateObject("Word.Application")
' app.Visible = true
app.Documents.Open("D:\TEMP\t\test.doc")
app.Options.PrintBackground = False
app.ActiveDocument.PrintOut

Regards,
Captain Cerebrum
Innovative stuff for IE4 and HTML Help authoring
http://www.meadroid.com/wpm/
FREE ScriptX: Dynamic Event Binding, Printing
http://www.meadroid.com/scriptx

Word, Excel, etc.

Quote:

>what app are you priting from?
>-cap.



Sun, 25 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
Hi Cap,

    I just tried the code you gave me and it works like a miracle!! Thanks
for your help.
Originally I had tried it another way where I'd pause the script for x
seconds and check every
x seconds to see whether background printing's done or not. But that didn't
work very smoothly.

This way's much better.

Thanks again.

Sam Tran


Quote:
>Here is a way... Set "app.Options.PrintBackground" to false and
>"app.ActiveDocument.PrintOut" won't return until completes printing. So you
may
>simply print step-by-step.

>Set app = Wscript.CreateObject("Word.Application")
>' app.Visible = true
>app.Documents.Open("D:\TEMP\t\test.doc")
>app.Options.PrintBackground = False
>app.ActiveDocument.PrintOut

>Regards,
>Captain Cerebrum
>Innovative stuff for IE4 and HTML Help authoring
>http://www.meadroid.com/wpm/
>FREE ScriptX: Dynamic Event Binding, Printing
>http://www.meadroid.com/scriptx


>Word, Excel, etc.


>>what app are you priting from?
>>-cap.



Mon, 26 Feb 2001 03:00:00 GMT  
 Exiting Office application whilst printing in background.
Enjoy :)
-cap.


Mon, 26 Feb 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Exiting Office application whilst printing in background.

2. Exiting Office application whilst printing in background.

3. Shutting down application whilst do...loop is running

4. Shutting down application whilst do...loop is running

5. Print Preview not using any office application ?

6. Office Application Bar (was Re: Office Assistant '97 Command Button: FREEWARE)

7. Check Out Of Office status on exit

8. Adding Forms and external code to Word / Office applications

9. Using RegRead to get version of Office Applications

10. Creating Office Applications

11. GetObject creates Word -- controlling visibility of Office applications

12. Excel.Application & Office Installed

 

 
Powered by phpBB® Forum Software