|
-
Jun 13th, 2002, 03:12 AM
#1
Thread Starter
Junior Member
When to quit the application
Below is my code for printing a word document embeded in ole container control.
This code calls print dialogbox using ....
wordobj.Dialogs(wdDialogFilePrint).Show
If OK button is pressed its start printing. But Its shows a messagebox saying that word has a print job running and ask if you want to quit the application.
I think I misplaced the next statement
wordobj.Quit
Actually I want the Word Application to quit when it finished the print job.
Now I am not able to know when this print event is finished.
So can anyone tell me how to quit word application.
Dim wordobj As Object
On Error GoTo ErrHandler
Me![wordOLE].Verb = 2 'Tells Access to open the application
Me![wordOLE].Action = 7 'Activates the application
Set wordobj = Me![wordOLE].object.Application
wordobj.Visible = False
wordobj.Dialogs(wdDialogFilePrint).Show
wordobj.Quit
Set wordobj = Nothing
Me![wordOLE].Action = 9
Me![wordOLE].Verb = -1
DoEvents
Exit Sub
ErrHandler:
MsgBox Error$
Exit Sub
__________________________
Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|