Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am writing Office COM addin. I need to catch mouse/ keyboard events, such as mouse click, key press inside the addin. Could somebody tell me some information about it? Thank you very much. fk |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When working with forms, each of the different objects including ActiveX
objects has the different Events. To look up the events, right click on the Object, then click on Properties Now click on "Event" tab. It's in there where you have MouseDown, MouseMove, MouseUp, KeyDown, KeyPress, and KeyUp events, if available, which should be in a good majority of the cases. Now click on one of those events, click on the "..." to the right of it, then click on "Code" If you have created your own objects, you will also have to create the events for that object in a class module of the object that deals with using the WithEvents command, something I still have yet to learn more about. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Hi, I am writing Office COM addin. I need to catch mouse/ keyboard events, such as mouse click, key press inside the addin. Could somebody tell me some information about it? Thank you very much. fk |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much for the message.
In fact, I am not using form. Instead, I am trying to catch the mouse click or keyboard press in choosing the menu I added with COM addin, say in EXCEL. After a user clicks mouse button or presses the keyboard to choose a menu (from top to the target menu), I try to start some work, such as thread, before starting to run the function for the target menu. For that reason, I am looking for some methods to catch the mouse and keyboard event. Do you have an idea about how to so? Regards. fk -----Original Message----- When working with forms, each of the different objects including ActiveX objects has the different Events. To look up the events, right click on the Object, then click on Properties Now click on "Event" tab. It's in there where you have MouseDown, MouseMove, MouseUp, KeyDown, KeyPress, and KeyUp events, if available, which should be in a good majority of the cases. Now click on one of those events, click on the "..." to the right of it, then click on "Code" If you have created your own objects, you will also have to create the events for that object in a class module of the object that deals with using the WithEvents command, something I still have yet to learn more about. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Hi, I am writing Office COM addin. I need to catch mouse/ keyboard events, such as mouse click, key press inside the addin. Could somebody tell me some information about it? Thank you very much. fk . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This sounds like you are trying to do some things with regards to the
CommandBars collection and CommandBar object. I haven't worked with that object too much in particular, but that is basically the collection and object you are attempting to capture the keystrokes with. I would at this point suggest start looking in the help files and online in that particular part of the help files. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Thank you very much for the message. In fact, I am not using form. Instead, I am trying to catch the mouse click or keyboard press in choosing the menu I added with COM addin, say in EXCEL. After a user clicks mouse button or presses the keyboard to choose a menu (from top to the target menu), I try to start some work, such as thread, before starting to run the function for the target menu. For that reason, I am looking for some methods to catch the mouse and keyboard event. Do you have an idea about how to so? Regards. fk -----Original Message----- When working with forms, each of the different objects including ActiveX objects has the different Events. To look up the events, right click on the Object, then click on Properties Now click on "Event" tab. It's in there where you have MouseDown, MouseMove, MouseUp, KeyDown, KeyPress, and KeyUp events, if available, which should be in a good majority of the cases. Now click on one of those events, click on the "..." to the right of it, then click on "Code" If you have created your own objects, you will also have to create the events for that object in a class module of the object that deals with using the WithEvents command, something I still have yet to learn more about. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Hi, I am writing Office COM addin. I need to catch mouse/ keyboard events, such as mouse click, key press inside the addin. Could somebody tell me some information about it? Thank you very much. fk . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After looking into it, you may want to take a look at the following code:
Take a look at the OnAction property of a CommandButton Example: Application.CommandBars("Worksheet Menu Bar").Controls("&Edit").Controls("Can't &Undo").OnAction = <StringNameOfMacro This is how you would set the name of the macro to the Click Event of the button such as this would set some macro to the "Can't &Undo" button that's on the "&Edit" menu, which is on the main Excel menu toolbar. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Thank you very much for the message. In fact, I am not using form. Instead, I am trying to catch the mouse click or keyboard press in choosing the menu I added with COM addin, say in EXCEL. After a user clicks mouse button or presses the keyboard to choose a menu (from top to the target menu), I try to start some work, such as thread, before starting to run the function for the target menu. For that reason, I am looking for some methods to catch the mouse and keyboard event. Do you have an idea about how to so? Regards. fk -----Original Message----- When working with forms, each of the different objects including ActiveX objects has the different Events. To look up the events, right click on the Object, then click on Properties Now click on "Event" tab. It's in there where you have MouseDown, MouseMove, MouseUp, KeyDown, KeyPress, and KeyUp events, if available, which should be in a good majority of the cases. Now click on one of those events, click on the "..." to the right of it, then click on "Code" If you have created your own objects, you will also have to create the events for that object in a class module of the object that deals with using the WithEvents command, something I still have yet to learn more about. -- Ronald R. Dodge, Jr. Production Statistician Master MOUS 2000 "Frank King" wrote in message ... Hi, I am writing Office COM addin. I need to catch mouse/ keyboard events, such as mouse click, key press inside the addin. Could somebody tell me some information about it? Thank you very much. fk . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mouse Up or Down Event | Excel Discussion (Misc queries) | |||
mouse over event | Excel Discussion (Misc queries) | |||
How do I 'catch' a 'delete cells' event | Excel Discussion (Misc queries) | |||
Catch Update Linked Cells Event | Excel Programming | |||
Mouse Click Event | Excel Programming |