Word 2000, CommandBars and Accelerator Keys. 
Author Message
 Word 2000, CommandBars and Accelerator Keys.

Hello everyone, I'm developing an COM Addin for Word2k using Visual C++ 6.

I've created a custom toolbar using CommandBars.

I've added a button using CommandBarControl.

I get the OnClick using _CommandBarButtonEvents.

I would also like to add an accelerator key to that button.  I can't seem to
find any help on that, can someone please point me in the right direction.

Also how would I create an accelerator key that will call a function in my
addin? (without a button attached to it?)

Sorry for the multi-group post,  I don't know which group will be able to
help me the most.

--
NectaR
____________________________________
CString's are for wimps!



Sun, 05 Jan 2003 03:00:00 GMT  
 Word 2000, CommandBars and Accelerator Keys.
Nectar:

Really simple :-)

When you set the caption to name the commandbarbutton, put an & in
front of the letter that you want to be the Accelerator key.

Example:

give tbrSubButton is a commandbarbutton object

tbrSubButton.Caption = "&Microsoft is Dumb"
or
tbrSubButton.Caption = "Gates is &Mad"

Will make "M" the accelerator key.

George

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 05 Jan 2003 03:00:00 GMT  
 Word 2000, CommandBars and Accelerator Keys.

Sorry,

I meant I want to set function keys, (Gates is Mad Alt-F6)

NectaR

Quote:

> Nectar:

> Really simple :-)

> When you set the caption to name the commandbarbutton, put an & in
> front of the letter that you want to be the Accelerator key.

> Example:

> give tbrSubButton is a commandbarbutton object

> tbrSubButton.Caption = "&Microsoft is Dumb"
> or
> tbrSubButton.Caption = "Gates is &Mad"

> Will make "M" the accelerator key.

> George

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sun, 05 Jan 2003 03:00:00 GMT  
 Word 2000, CommandBars and Accelerator Keys.
As copied from Word VBA Help file:

Use the Add method to add a KeyBinding object to the KeyBindings collection.
The following example adds the CTRL+ALT+H key combination to the Heading 1
style in the active document.

CustomizationContext = ActiveDocument
KeyBindings.Add KeyCategory:=wdKeyCategoryStyle, Command:="Heading 1", _
    KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyH)

Regards,
Bob Dietz

Quote:

> Sorry,

> I meant I want to set function keys, (Gates is Mad Alt-F6)

> NectaR


> > Nectar:

> > Really simple :-)

> > When you set the caption to name the commandbarbutton, put an & in
> > front of the letter that you want to be the Accelerator key.

> > Example:

> > give tbrSubButton is a commandbarbutton object

> > tbrSubButton.Caption = "&Microsoft is Dumb"
> > or
> > tbrSubButton.Caption = "Gates is &Mad"

> > Will make "M" the accelerator key.

> > George

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.



Sun, 05 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Word 2000 commandbar button

2. Accelerator Key Display in Custom Menu

3. Accelerator key problem

4. Accelerator key takes 2 tries to open combobox

5. UserForm, CommandButton, Accelerator Key

6. User Forms, Command Buttons, Accelerator Keys

7. Accelerator keys in VB.NET

8. Accelerator keys won't display on form load

9. Accelerator keys on toolbar?

10. Accelerator Keys not recognized

11. Accelerator Keys in SSTab control

12. Accelerator Keys in VBS?

 

 
Powered by phpBB® Forum Software