PC Review


Reply
Thread Tools Rate Thread

Custom help attached to CommandButton

 
 
=?Utf-8?B?V2VuZHkgVg==?=
Guest
Posts: n/a
 
      6th Nov 2007
Is it possible to attach a custom help file to a CommandButton embedded in an
excel sheet so that when the button takes focus and I press F1, my custom
help file pops up? I could not find the HelpContextID property for my
command button.

Wendy
(Excel 2003, WinXP Pro)
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      6th Nov 2007
Hi Wendy,

I don't think possible directly, at least not in the same way as in theory
possible with a control in a form.

You might try something like the following to detect if F1 was pressed while
the button was in focus, in the sheet module -

Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
Const cHelpID as long = 1100 ' help constant ID
If KeyCode = vbKeyF1 then
Call myHTMLhelp(cHelpID)
end if
End Sub

where myHTMLhelp is your routine to call the HTML help API (assuming you are
not using WinHelp)

Regards,
Peter T

"Wendy V" <(E-Mail Removed)> wrote in message
news:677D6D24-4E6C-4131-A8BD-(E-Mail Removed)...
> Is it possible to attach a custom help file to a CommandButton embedded in

an
> excel sheet so that when the button takes focus and I press F1, my custom
> help file pops up? I could not find the HelpContextID property for my
> command button.
>
> Wendy
> (Excel 2003, WinXP Pro)



 
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
Custom shortcutmenu for commandbutton to open form with arguments xcskiier Microsoft Access Form Coding 0 5th Jan 2010 03:46 AM
How do I make a commandbutton in Excel 'launch' a custom form? =?Utf-8?B?Y2hvcmlzbW9z?= Microsoft Excel Programming 2 12th Oct 2006 04:12 PM
How do I link a macro to a CommandButton in a custom form, want us =?Utf-8?B?Q3lib3JkZWxpYw==?= Microsoft Outlook Form Programming 11 5th Feb 2006 12:15 AM
adding custom commandbutton's to Slide Show popup menu ged6713@uncw.edu Microsoft Powerpoint 3 2nd Jan 2005 03:03 AM
Custom forms attached to emails =?Utf-8?B?RXJpYw==?= Microsoft Outlook Form Programming 0 5th Nov 2004 10:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.