How to identify in BeforePrint if choice was Preview or Print?

ChgsAllAround

New Member
Joined
Apr 11, 2008
Messages
36
I am needing to run a macro AFTER printing. Since there is no AfterPrint, the only way to do this is to trap with Workbook_BeforePrint, cancel the automatic print/preview, code it manually and followup with the macro. (Excel 2003)

My problem now is knowing if the user chose Preview or Print. I've seen a few close ideas that involve CommandBar, but nothing that would say something like:
Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
If the user picked PrintPreview then
ActiveWindow.ActiveSheet.PrintPreview
else
ActiveWindow.ActiveSheet.PrintOut
end if
Run the macro
end sub

Does anyone know how to tell which was chosen and how I would code it?
Thanks!
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Watch MrExcel Video

Forum statistics

Threads
1,099,795
Messages
5,470,827
Members
406,727
Latest member
Kimze

This Week's Hot Topics

Top