View Single Post
  #1  
Old March 31st 06, 03:08 PM posted to microsoft.public.outlook.program_addins
Laks
external usenet poster
 
Posts: 5
Default Assigning shortcuts to Custom toolbar buttons

Hi,

I want to add a toolbar button and assign a short cut to this button. I
am using .NET Extensibility/C# to do this. I have been able to add this
button and I have set the caption with the standard windows '&' and am
able to access the button with Alt combination accelerators. However, I
also noticed that the CommandBarButton has a ShortCutText property and
after googling this up a bit, I found that this would only work for
those buttons that have an associated OnAction. My add-in is a 'Load On
Demand' add-in and thus my OnAction property would read something like

button.OnAction = "!MyAddIn.Connect";

And after this, I have

button.ShortCutText="Ctrl+G";

But after the add-in loads, Ctrl+G does not cause anything. Setting the
ShortCutText property does not seem to have made any difference. Am I
doing anything wrong here?

And one more question is that if I assign already existing Outlook
shortcuts (like ctrl+n for example) to my button, what would happen?

Any help is greatly appreciated. Thanks in advance.

Regards,
Laks

Ads