Solved

Bind shortcut key to a function in VSTO

Posted on 2009-07-02
5
968 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now