ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   afterprint event? (https://www.excelbanter.com/excel-programming/398497-afterprint-event.html)

sali

afterprint event?
 
there is an workbook beforeprint event, that is triggered when you start
printing.
is there some event [or some way to simulate it] that will be triggered when
the print job is generated and sent to the spooler/printer?

reason:
i have some fancy formating that is nice when you look at the screen, but is
not acceptable to be printed on the b/w laser
so, beforeprint event easily remove that formating when going to print, but
how to restore that formating automaticly after print is done?

[version: excel 2000]

thnx!



Mike H

afterprint event?
 
Hi,

You might try this:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Static Printit As Boolean
If Printit = True Then Exit Sub
Printit = True
ActiveSheet.PrintOut

'This code executes after printing
MsgBox "Print comp" 'Delete this line and put your own code in
Printit = False
Cancel = True
End Sub

Mike

"sali" wrote:

there is an workbook beforeprint event, that is triggered when you start
printing.
is there some event [or some way to simulate it] that will be triggered when
the print job is generated and sent to the spooler/printer?

reason:
i have some fancy formating that is nice when you look at the screen, but is
not acceptable to be printed on the b/w laser
so, beforeprint event easily remove that formating when going to print, but
how to restore that formating automaticly after print is done?

[version: excel 2000]

thnx!




sali

afterprint event?
 
thnx!

nice idea to use eventproc itself to cancel its own event [suicide]


"Mike H" je napisao u poruci interesnoj
...
Hi,

You might try this:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Static Printit As Boolean
If Printit = True Then Exit Sub
Printit = True
ActiveSheet.PrintOut





All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com