Solved

Bind shortcut key to a function in VSTO

Posted on 2009-07-02
5
994 Views
1 Endorsement
Last Modified: 2013-11-10
I currently doing a word VSTO, I need to bind my shortcut key to a function. Example binding a shortcut key "ctrl + D" to display a message box. How do I do it using VB.net?
1
Comment
Question by:KenTan85
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:xenacode
ID: 24770698
Unfortunately VSTO doesn't support shortcut keys. You can however add key tips to controls on the ribbon (if this is Office 2007) e.g. by setting the KeyTip property to "D". This requires the user to press Alt + D instead of Ctrl + D and of course you need a ribbon control.

Pete
0
 

Author Comment

by:KenTan85
ID: 24771048
But the keytip need to hold on the alt to go to the right ribbon before I can do a alt + D. Is there way to skip the 1st alt?
0
 
LVL 6

Expert Comment

by:xenacode
ID: 24771080
No
0
 

Author Comment

by:KenTan85
ID: 24771096
Then I understand that vba can assign shortcut key. Is it possible to make VSTO call a VBA marcos to assign a shortcut key then?
1
 
LVL 6

Accepted Solution

by:
xenacode earned 500 total points
ID: 24771141
VSTO solutions and macros are really two completely separate things. It may be that a macro is actually the best solution for you here. (I very rarely say those words!)

Pete
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Slow process to read Excel 15 148
WPF issue with Trigger 2 130
Please explain "Promise Pattern" and how it's used 2 58
Shared files and folders migration 2 27
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question