How do I catch msoControlSplitDropdown Click events?

A

Alex

Hello,

I am trying to catch when the user clicks on a msoControlSplitDropdown control.

However, it seems that I can only catch the Change event of these controls but not the Click.

Is there a way to do that?


Best wishes,
Alex.
 
W

Wei-Dong XU [MSFT]

Hi Alex,

Currently I am finding one support professional for you on this issue. When
any update, we will reply for you at the first time.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services
This posting is provided "AS IS" with no warranties, and confers no rights.
It is my pleasure to be of assistance.
 
P

Peter Huang [MSFT]

Hi

Based on my research, the msoControlSplitDropdown is a CommandBarComboBox
actually.
But the Office Object Modal only expose the Change event for
CommandBarComboBox.
So there is no such a event(click) for us to catch.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex

Hello Peter,

Peter Huang" said:
Based on my research, the msoControlSplitDropdown is a CommandBarComboBox actually.

Yes, I figured that out.
But the Office Object Modal only expose the Change event for CommandBarComboBox.
So there is no such a event(click) for us to catch.

So is there no way for me to detect that a user clicked on the button part of the CommandBarComboBox?
A macro perhaps?


Best wishes,
Alex.
 
P

Peter Huang [MSFT]

Hi

I think it is hard to do that.
The whole ToolBar is window, each button's message is handled inside the
Word process, because it did not expose the interface(such as the Click
Event) , we can not handle it since the word's code is not public.

OL: How to Use CommandBars in Outlook Solutions
http://support.microsoft.com/kb/q201095/

For your scenario, I think you may try to send your feedback in the link
below.
http://office.microsoft.com/en-us/suggestions.aspx?Sitename=0&Type=2

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex

Hello Peter,

Peter Huang" said:
I think it is hard to do that.
The whole ToolBar is window, each button's message is handled inside the
Word process, because it did not expose the interface(such as the Click
Event) , we can not handle it since the word's code is not public.

Hmmm... When would the OnAction property of the msoControlSplitDropdown get invoked then?

I am trying to hook into the Word Undo/Redo commands.
A macro can successfully catch the Ctrl-Z and Ctrl-Y key presses but it just does not work with the standard undo/redo buttons.

Any suggestions?
 
P

Peter Huang [MSFT]

Hi

Here is some information for the OnAction.
ctlButton.OnAction = "!<ProgID>"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/htm
l/deovrHookingCOMAddinUpToCommandBarControl.asp

Also you may try to use EditUndo and EditRedo macro to hook the undo/redo
behavior.
http://groups.google.com/group/microsoft.public.office.developer.com.add_ins
/browse_thread/thread/14302fe4ebb687e1/a9a1f2061835bfac?lnk=st&q=EditUndo+Ed
itRedo&rnum=15&hl=zh-CN#a9a1f2061835bfac

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi,

Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex

Peter Huang" said:
Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Thank you Peter!


Best wishes,
Alex.
 
P

Peter Huang [MSFT]

Hi

Based on my research, I think we have to make the redo/undo button
invisible and add our customized button, make it similar with the redo/undo
button .
Because we add a CommandBarButton, we can handle its click event.
In its click event, we can call the Undo Method

Undoes the last action or a sequence of actions, which are displayed in the
Undo list. Returns True if the actions were successfully undone.

expression.Undo(Times)
expression Required. An expression that returns a Document object.

Times Optional Variant. The number of actions to be undone.

Example
This example undoes the last two actions taken in Sales.doc.

Documents("Sales.doc").Undo 2

This example undoes the last action. If the action is successfully undone,
a message is displayed in the status bar.

On Error Resume Next
If ActiveDocument.Undo = False Then _
StatusBar = "Undo was unsuccessful"



Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex

Hello Peter,

Peter Huang" said:
Based on my research, I think we have to make the redo/undo button
invisible and add our customized button, make it similar with the redo/undo
button .
Because we add a CommandBarButton, we can handle its click event.
In its click event, we can call the Undo Method

Undoes the last action or a sequence of actions, which are displayed in the
Undo list. Returns True if the actions were successfully undone.

expression.Undo(Times)
expression Required. An expression that returns a Document object.

Times Optional Variant. The number of actions to be undone.

Example
This example undoes the last two actions taken in Sales.doc.

Documents("Sales.doc").Undo 2

This example undoes the last action. If the action is successfully undone,
a message is displayed in the status bar.

On Error Resume Next
If ActiveDocument.Undo = False Then _
StatusBar = "Undo was unsuccessful"

Isn't there any way to keep the ControlSplitDropdown functionality?


Best wishes,
Alex.
 
P

Peter Huang [MSFT]

Hi

I think it is hard to do that.
Due to the OM, if we want the click event, we need to use the
CommandBarButton class, because the ComboBox class did not have click event
exposed.
Also the whole Office OM's concrete implement is not public, if you still
have concern, I think you may try to post the feedback in the website below.
http://office.microsoft.com/en-us/suggestions.aspx?Sitename=0&Type=2

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top