Looking for a 'Close Print Preview' event

M

Michelle

I want to alter a sheet when the user goes into print preview (no problem
with that - I use the BeforePrint event)

But I want to put it back to normal when the user closes print peview. Is
there an event I can use to put it back? - a sort of 'AfterPrintPreview'
event.

Thanks

M
 
H

Héctor Miguel

hi, Michelle !
I want to alter a sheet when the user goes into print preview (no problem with that - I use the BeforePrint event)
But I want to put it back to normal when the user closes print peview.
Is there an event I can use to put it back? - a sort of 'AfterPrintPreview' event...

(AFAIK) *IF* the user goes first into a print preview, '_beforeprint' event could it be triggered twice
- one when print preview is choosen
- once more *IF* the user chooses *print* from there

also, the print preview (dialog) can be closed either by *cancel* or *print*, so...
- which one do you think should it be "controlled" ?

(FWIW) you can simulate an '_afterprint' event by using a normal procedure
-> called by "OnTime" in '_beforeprint' event (i.e.)

== in ThisWorkbook code module ==
Private Sub Workbook_BeforePrint(Cancel As Boolean)
' do your stuff here, and...
' when the user releases the control (from the dialog) to the application... '
Application.OnTime Now, "afterprint_macro"
End Sub

== in a standard code module ==
Private Sub AfterPrint_Macro()
' here goes your afterPrint actions ... '
End Sub

hth,
hector.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top