How do I create an onclick event for Ctrl-C etc.

Add-in Express™ Support Service
That's what is more important than anything else

How do I create an onclick event for Ctrl-C etc.
 
Kevin Peirson




Posts: 2
Joined: 2005-04-11
I want to make an event that happens any time that a person copys something. I have a hook on the copy button for when it is pressed using BuiltInID = 19 but the event does not happen if the user presses Ctrl-C. Do I need to find the BuiltInID associated with a Ctrl-C or is their another method that will encompass any attempt to copy via any method?
Posted 11 Apr, 2005 17:43:38 Top
Dmitry Kostochko


Add-in Express team


Posts: 2841
Joined: 2004-04-05
Hi Kevin,

As far as I remember the keyboard shortcuts don't fire a command bar button event. May be there is another way to perform this task. Can you explain what you need to do?

Posted 12 Apr, 2005 07:05:51 Top
Kevin Peirson




Posts: 2
Joined: 2005-04-11
Sorry it took me so long to respond. What I am trying to do is capture any time that a copy, cut or paste is performed and log that action. In order to do this I am going to need to find a way to capture the control shortcuts as well as the menu buttons. I figured that the OfficeID for the menu button would encompass any method of copying. My only other thought would be to maybe use the EasterEgg widget that comes with the JEDI components. Let me know if there is a way to hook the control events with any of the ADX components. Thanks for the help.
Posted 18 Apr, 2005 10:26:34 Top
Dmitry Kostochko


Add-in Express team


Posts: 2841
Joined: 2004-04-05
Hi Kevin,

With Add-in Express you can hook any command bar button click. Unfortunately keyboard shortcuts don't fire events. Also, Office Object Model doesn't contain any events of the kind you need. So, I think you will have to create either a global keyboard hook or capture the main WindowProc of the host application and filter window messages.

Posted 18 Apr, 2005 11:59:19 Top
John Murray




Posts: 11
Joined: 2005-12-08
It is possible to bind a keyboard key to a specific VBA macro. Is it possible to generate an event from a VBA macro that would be captured by ADX?

Thanks,

John
Posted 08 Dec, 2005 16:58:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2841
Joined: 2004-04-05
Hi John,

I think it is possible. What host application (Word, Excel, etc.) do you need to support?

Posted 09 Dec, 2005 09:54:16 Top
John Murray




Posts: 11
Joined: 2005-12-08
I am trying to write an add-in for Word. I would like notice when a user types in a digit such as 1,2,3,4,5,6,7,8,9, or 0. I then want to run some checks, similar to a spell-checker, on the document immediately after a number key is added to the document. I may highlight some words in the document associated with the numbers in the document.

I noticed that it is possible in VBA to setup a keybinding for individual key presses and call a VBA macro following such a key press. Using this approach, I though I could create a single VBA macro that is bound to the digit keys that would then call a funciton in my add-in.

My first question is whether this is possible with an add-in.

My next question is whether I would be better off using Delphi or VStudio. I am assuming that with the VCL version of ADX, the code is still compiled to MSIL and that the same performance hit is taken using DELPHI as with VS, right?

Thank you,

John
Posted 10 Dec, 2005 17:59:12 Top
Dmitry Kostochko


Add-in Express team


Posts: 2841
Joined: 2004-04-05
Hi John,

First question - in general your approach is correct but note please, it is impossible to bind to digital keys only. You will have to bind to key combinations like Ctrl+0, Ctrl+1, etc.

Second question - incorrect. The VCL edition isn't compiled to MSIL, it is pure Win32 code.

Posted 12 Dec, 2005 08:20:52 Top
Guest


Guest


Thank you for your assistance! In response to the second answer, how much better is the performance with VCL over MSIL when working with MS Word
1. For loading MS Word
2. For running an add-in with MS Word

Thank you!

John
Posted 12 Dec, 2005 09:51:47 Top
Dmitry Kostochko


Add-in Express team


Posts: 2841
Joined: 2004-04-05
Hi John,

After compiling the add-in based on Add-in Express VCL Edition you will get native Win32 code. I've never compared the difference in performance between Win32 and MSIL code but I think there is a difference.

Posted 12 Dec, 2005 11:57:21 Top