Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to catch mouse/keyboard event in Office addin

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default How to catch mouse/keyboard event in Office addin

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to catch mouse/keyboard event in Office addin

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default How to catch mouse/keyboard event in Office addin

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default How to catch mouse/keyboard event in Office addin

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Up or Down Event billinr Excel Discussion (Misc queries) 2 July 5th 07 07:46 PM
mouse over event rk0909 Excel Discussion (Misc queries) 1 September 3rd 06 02:51 PM
How do I 'catch' a 'delete cells' event Eric Excel Discussion (Misc queries) 2 March 9th 05 07:22 PM
Catch Update Linked Cells Event Joe[_23_] Excel Programming 1 August 14th 03 02:39 PM
Mouse Click Event Srinath Excel Programming 2 July 18th 03 04:03 AM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"