open BackstageView by clicking on Ribbon button?

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

open BackstageView by clicking on Ribbon button?
 
aweber




Posts: 83
Joined: 2013-11-21
Is it possible to set the OnClick of my adxRibbonButton (on my custom Tab) to "redirect" and open my BackstageView?

Thanks,
AJ
Posted 05 Dec, 2013 12:02:43 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Posted 06 Dec, 2013 06:27:37 Top
aweber




Posts: 83
Joined: 2013-11-21
Thank you for the links, I'm starting to read through the details now, but my first thought is:

Wouldn't this be a great feature to add to Add-in Express? Take the complexity out of this and add an additional, powerful capability to the toolkit?

-AJ
Posted 06 Dec, 2013 08:02:30 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Thank you for the suggestion.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Dec, 2013 08:56:03 Top
aweber




Posts: 83
Joined: 2013-11-21
Andrei,

I implemented a recursive method to go from the Word "Main Window" and find all "Accessibility Objects" and print out the object's Name and Role property.

I can't find any of the Word 2010 BackstageView "tabs", much less my custom one. I can see all of my custom Ribbon tabs, groups and controls (and the default ones), but enumerating the File menu's tabs (as they are in 2010) is somehow missing.

Do you know if this is possible at all? Do you have any other ideas as to how to find my tab within the Addin code (and then basically navigate/invoke the tab from a Ribbon button)?

Thanks again,
AJ
Posted 11 Dec, 2013 15:17:54 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
aweber writes:
Do you know if this is possible at all?


Unfortunately, I don't know an answer to this question.

Using Accessibility is a standard advice on activating a backstageview tab, see e.g. http://social.msdn.microsoft.com/Forums/office/en-US/9c7da0fb-5838-485e-9dfc-304f3675cf4f/how-to-activatetabprint-in-backstage-programmatically-in-office-2010 or http://social.msdn.microsoft.com/Forums/office/en-US/20bae5d9-5834-49f2-8157-0db12b5237e6/call-custom-backstage-tab-from-ribbon-button. But I should admit that I've never read about ANY results of using this approach. Still I doubt it that Microsoft have left us without a way to access those controls.

aweber writes:
Do you have any other ideas as to how to find my tab within the Addin code (and then basically navigate/invoke the tab from a Ribbon button)?


Using SendKeys?


Andrei Smolin
Add-in Express Team Leader
Posted 12 Dec, 2013 08:09:13 Top
aweber




Posts: 83
Joined: 2013-11-21
On further review, I can tell you that the "File Tab" is named exactly that, but it is a "push button" Role/Object - not a "page tab" as other Ribbon Tabs are designated. It apparently has no children.

I have been successful in opening that "Tab" by invoking the default action on the "File Tab" push button, and thinking that MSFT might be dynamically generating the supporting view, after activating the File Tab, tried to list all the children of the control again, but it still has no children.

UPDATE: I get inconsistent results from traversing the children...but I may have found it in one of my traces (again, I'm not sure why I get wildly different lists of Accessibility Objects from the same test of MS Word 2010). It appears as a role = "property page" in one of the traces...I'm going to try accessing it that way...


BTW: Is there a way to assign a key-shortcut to my BackgroundView Tab? I would do that for simplicity's sake, even if the MSFT-technically-recommended method is to use Accessibility Objects!

Thanks again,
AJ
Posted 12 Dec, 2013 08:48:20 Top
aweber




Posts: 83
Joined: 2013-11-21
UPDATE AGAIN:
Despite finding the Property Page, it either doesn't exist, or can't be invoked from elsewhere on the Ribbon in tests thus far. (I have tested trying to launch the backstageview before and after manually clicking on it to view it -- neither works.)

Invoking the "Default Action" on the Property Page does nothing. It is possible that is "by design" and I don't want to search for the Property Page object, but some other object that invokes my backstage view -- though I have seen nothing named anything remotely similar to my tab/view.

The only thing I can pretty-consistently do so far is open the File Tab/Button.

-AJ
Posted 12 Dec, 2013 09:03:49 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Could you open the file tab and re-check the children after a delay? Say, you can use a System.windows.Forms.Timer to create a delay. I guess any small value would be enough e.g. 100 ms.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Dec, 2013 09:11:19 Top
aweber




Posts: 83
Joined: 2013-11-21
Andrei Smolin writes:
Could you open the file tab and re-check the children after a delay? Say, you can use a System.windows.Forms.Timer to create a delay.

I could, I guess, but I'm not sure it'll help. If you read through the posts you found on the MSDN boards, it appears that no one believes there's any way except using SendKeys as a workaround (this is very unfortunate, because we all know there are a few pitfalls with that approach).

I have had some good luck with a hybrid of finding the File Tab using the Accessibility interface, activating the tab that way, then sending the keys for my BackstageView (tab).

It's very "kludgy" and seems like there should be a better way. Even though MSFT "hides" some of their features/functionality from developers (which is a different issue, IMHO), this feels like they forgot to implement something.

It might be something you guys investigate for a future version of Addin Express, but it might be just not exposed in any reliable way that you can include. I would love to be proved wrong!!! :)

-AJ
Posted 12 Dec, 2013 10:05:50 Top