Search: none
Add a search phrase to search resource page titles and descriptions. Different keywords are ANDed with tags.
 

MSDN Archive

Target and filter your gallery search using the following dynamic dialogues.
1-1 of 1Resources < Previous 1 Next >
Resource Page Name and Description Current Release
One of the limitations (IMHO) in Office Ribbon is - you can't switch the tabs programmatically and you can't "click" the ribbon buttons programmatically. Yes. Sometimes "clicking" office buttons be...
One of the limitations (IMHO) in Office Ribbon is - you can't switch the tabs programmatically and you can't "click" the ribbon buttons programmatically. Yes. Sometimes "clicking" office buttons becomes a requirement (i.e. cmdbarbutton.execute won't help), like in cases when you want to execute the "already repurposed" button. If you "execute" the button, it will call the default functionality, not the ""repurposed" functionality. Here are the details and the story behind this sample :) Few days back I had an interesting case where one of our customers wanted to switch the ribbon programmatically, from the surface it looks easy ... but unfortunately currently there is no programmatic way to do it. So, I started digging for a prospective workaround ... OM doesn't give us anything Can't simply use win32 APIs as ribbon tab is not a "window" The first piece of the "gyan" that I can use active accessibility for this issue was from http://blogs.msdn.com/oldnewthing/archive/2006/08/16/702526.aspx After looking at it I Started playing with "Active Accessibility" APIs. After some more trial and error it was clear that I'll need to use a combination of Win32 APIs and "Active Accessibility" APIs. Built a sample library which basically does the following:- Based on inputs it will try to find the window of a specific office program (excel, word, powerpoint, etc) Then it will get the ribbon object [EnumWindows] Then we’ll get the IAccessibile object for the ribbon object We’ll recurse through the IAccessibility tree and find the control that you specify We’ll execute its default action (in case of ribbon tabs the default action is switch, for buttons it’s click and for the dropdowns it’s drop) Due to the characters limitations of this page visit my blog http://blogs.msdn.com/pranavwagh/archive/2008/01/21/how-to-switch-ribbon-tab-programmatically-looks-simple.aspx for the more details
Downloads: 5 | Started: Jan 31 2008  | Contributors: 1
Updating...
Page view tracker