PC Review


Reply
Thread Tools Rate Thread

Determining which Print Button was clicked

 
 
Reggie
Guest
Posts: n/a
 
      15th Aug 2008
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,
 
Reply With Quote
 
 
 
 
james.billy@gmail.com
Guest
Posts: n/a
 
      15th Aug 2008
On Aug 15, 11:12*am, Reggie <Reg...@discussions.microsoft.com> wrote:
> 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
 
Reply With Quote
 
Reggie
Guest
Posts: n/a
 
      18th Aug 2008
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

"(E-Mail Removed)" wrote:

> On Aug 15, 11:12 am, Reggie <Reg...@discussions.microsoft.com> wrote:
> > 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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I capture if the user clicked the PRINT button diego Microsoft VB .NET 0 23rd Aug 2006 03:53 AM
How to know if Crystal Report's Print button was clicked _(d)IEGO Microsoft Dot NET 0 17th Aug 2006 07:34 AM
Determining which Menu Item is Clicked Elliot Microsoft VB .NET 1 10th Mar 2005 10:19 PM
How do I check if a user clicked the Print Cancel button joanne Microsoft Excel Programming 0 5th Sep 2003 08:24 AM
Re: Determining if a hyperlink button to external site has been clicked. William F. Robertson, Jr. Microsoft ASP .NET 0 30th Jun 2003 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 AM.