Determining which Print Button was clicked

R

Reggie

Hi,

I'm using the Application WorkbookBeforePrint Event to hijack the normal
Print and Print Preview functions in Excel 2003 & display some customised
options. How do I determine whether the user clicked the Print button or the
Print Preview button?

thanks,
 
J

james.billy

Hi,

I'm using the Application WorkbookBeforePrint Event to hijack the normal
Print and Print Preview functions in Excel 2003 & display some customised
options.  How do I determine whether the user clicked the Print button or the
Print Preview button?

thanks,

As far as I know you are unable to. There are at least a couple of
workarounds though...

1) Put a print button on your worksheet and control everything from
there. (by far the simplest, just need to educate the users...)
2) Manipulate the toolbar and replace the standard print and print
preview buttons with your own code, you would then need to reset them
upon closing your workbook.

James
 
R

Reggie

Hi James,

thankyou for your response.

I beileve we should be able to determine the button that is clicked by
examining the "state" property of the clicked control, but it appears it is
not being set correctly by Excel. When I look at the property it says
msobuttonup when in fact it is msobuttondown.

I'm still looking into this & will advise what I find.

Would any MVP's out there care to comment on this...

cheers,

Gregory
 

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