A
ATS
HOWTO Make a Word Doc Template do tasks when user goes to print.
Please help, I'm kind of new to VB for Word
I want to make a Word for Windows document template that traps the "onprint"
event to do "things" in the back ground, just after the print has completely
succeeded.
First of all, I can not even slightly find a "onprint" event like "thingy"
in the Word's Macro/VB editor for Word 2000. It should be something like
Sub Document_OnPrint
MsgBox "Hello!!!!"
End Sub
The next thing is how to know that printing succeeded. That is, how to know
that as far as "Word" is concerned, the print job succeeded. It should be
something like this:
Sub Document_OnPrint
Results = Document.~~~Finish~~The~~Print~~Job()
If Result = ~~SUCCESS~~ Then
~~~~ Do My Stuff... ~~~~
End If
End Sub
Lastly, I want (if possible) to "trap" all of the output parameters that
were used for the print job so that I can "duplicate" them into a "background
print job", kind of like this:
Sub Document_OnPrint
PrintJobSettings = Document.Get~~Print~~Job~~Settings
Results = Document.~~~Finish~~The~~Print~~Job()
If Result <> ~~SUCCESS~~ Then
Exit Sub
End
Document.Create~~New~~Print~~Job ~~Pass~~In~~ PrintJobSettings
Results = Document.~~~Finish~~The~~Print~~Job()
If Result <> ~~SUCCESS~~ Then
MsgBox "Oh oh!!!!"
End
End Sub
Please help, I'm kind of new to VB for Word
I want to make a Word for Windows document template that traps the "onprint"
event to do "things" in the back ground, just after the print has completely
succeeded.
First of all, I can not even slightly find a "onprint" event like "thingy"
in the Word's Macro/VB editor for Word 2000. It should be something like
Sub Document_OnPrint
MsgBox "Hello!!!!"
End Sub
The next thing is how to know that printing succeeded. That is, how to know
that as far as "Word" is concerned, the print job succeeded. It should be
something like this:
Sub Document_OnPrint
Results = Document.~~~Finish~~The~~Print~~Job()
If Result = ~~SUCCESS~~ Then
~~~~ Do My Stuff... ~~~~
End If
End Sub
Lastly, I want (if possible) to "trap" all of the output parameters that
were used for the print job so that I can "duplicate" them into a "background
print job", kind of like this:
Sub Document_OnPrint
PrintJobSettings = Document.Get~~Print~~Job~~Settings
Results = Document.~~~Finish~~The~~Print~~Job()
If Result <> ~~SUCCESS~~ Then
Exit Sub
End
Document.Create~~New~~Print~~Job ~~Pass~~In~~ PrintJobSettings
Results = Document.~~~Finish~~The~~Print~~Job()
If Result <> ~~SUCCESS~~ Then
MsgBox "Oh oh!!!!"
End
End Sub