Hi,
Basically I would like to use VBA to determine the number of pages that were printed. Ie if one page of a document was printed only I would like to perform a different function than if the whole document was printed.
Is this possible?
To explain further I have a button on a toolbar to print one page only (ActiveDocument.PrintOut Range:=wdPrintCurrentPage) if this button is pressed I want to turn off printing comments.. I know I could do this by the following code:
Options.PrintComments = False
However there is an event handler that is called before printing which turns comments back on!!
Private Sub oApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
Options.PrintComments = True
End Sub
So even if I turned the comments off in the code for my toolbar button, they would still turn on again!
I'm sure there is a simple way to do this but I'm tearing my hair out here.
Thanks for any help anyone can give me!
Basically I would like to use VBA to determine the number of pages that were printed. Ie if one page of a document was printed only I would like to perform a different function than if the whole document was printed.
Is this possible?
To explain further I have a button on a toolbar to print one page only (ActiveDocument.PrintOut Range:=wdPrintCurrentPage) if this button is pressed I want to turn off printing comments.. I know I could do this by the following code:
Options.PrintComments = False
However there is an event handler that is called before printing which turns comments back on!!
Private Sub oApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
Options.PrintComments = True
End Sub
So even if I turned the comments off in the code for my toolbar button, they would still turn on again!
I'm sure there is a simple way to do this but I'm tearing my hair out here.
Thanks for any help anyone can give me!