Office 2010 Backstage UI problem in both Word and Excel-Collection of common programming errors
msdnI need to modify the Backstage UI in a few Word documents and the content must be dynamic and reflect the state of the document each time the backstage is displayed.
This is ‘no problem’ when using the onShow attribute in the XML:
In the OnShow() callback I invalidate the Backstage and it works fine, BUT…. If I open another document (not a macro enabled document) and click on the File tab I get an error telling me the macro can not be found. The newly opened document has no macro and therefore OnShow can not be called. This means the onShow callback is allways called on the ACTIVE document and not the document the modified Backstage is defined in. I tried to create global template with a callback macro and then no problem, but that is no solution to this problem. The behaviour is the same in Excel.
Is there a way to get around this problem? The validation must be done when the backstage is displayed without any user actions, more than clicking on the File tab in Word.
I hope someone can help me as this is becoming a showstopper. You can’t tell the customer to have only one document open at a time.
Regards,
Lars-Eric-
12 Answers
msdn1Hi,
Unfortunately, the backstage onShow property will only work correctly when the callback macro that’s fired is available globally for each Word document – as in having the code in a global template that loads at startup. (I know you had mentioned that you were aware that this worked, but it was not an option in your scenario.)
Regards,
msdn2Hi Lars-Eric,
Thanks for your reply.
I’ll log the scenario, where you expect the Office 2010 backstage onShow property to work at the file level (.docm/.xlsm/pptm) and not generate a “… macro cannot be found …” error when a different file without the callback code is active, with the Office development team as a scenario to be supported.
Thus, you don’t need to open a support case to get the issue to our development group.
Regards,
msdn3Hi Lasr-Eric,
Thank you for your steps and I have reproduced this scenario.
But I am not sure whether this is a issue or by design. I will involve someone who are more familiar about this.
Best Regards,
Bruce Song [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
msdn4Hello Bruce and thanks for your reply.
For me this is a serious issue. I have very hard to understand a design that generates runtime errors that you can’t catch. I think nobody at this forum want to deliver solutions to customers that generates runtime errors out of control like this. We have customers from small to consulting companies to big healthcare administrations and big companies like IBM and GE Capital. It would not look serious to deliver solutions that generates runtime errors, like this, out of my control.
I really think, and hope, it’s just a design issue, something they didn’t think about when they designed the Backstage. You can even find examples on MSDN using exactly this technology and I don’t think those examples are intended to generate runtime errors with no control from the developers side.
Regards,
Lars-Eric
msdn5Hi,
Unfortunately, the backstage onShow property will only work correctly when the callback macro that’s fired is available globally for each Word document – as in having the code in a global template that loads at startup. (I know you had mentioned that you were aware that this worked, but it was not an option in your scenario.)
Regards,
msdn6Helli Bill,
Thanks for looking into this.
I think this shoud be an enhancement request. We can’t use a global template and install it on several thousand of computers all over the country. As you can not make the backstage dynamic in a reliable way I see this as a major design issue for the backstage. We have another issue about the ‘sandbox’ mode that we had a support case about and is now filed as a bug.
If you have no possibility to make this as an enhancemant request we will concider open a support case again and try to report it as a bug as Word report errors in a way that is out of control for the user, and no errors done by the user.
Regards,
Lars-Eric
msdn7Hi Lars-Eric,
Thanks for your reply.
I’ll log the scenario, where you expect the Office 2010 backstage onShow property to work at the file level (.docm/.xlsm/pptm) and not generate a “… macro cannot be found …” error when a different file without the callback code is active, with the Office development team as a scenario to be supported.
Thus, you don’t need to open a support case to get the issue to our development group.
Regards,
msdn8Hello Bill,
Thank you very much for your assistance. I really appreciate you forward this issue to the development team.
I have met the dev team ones in Seattle on a MS conference for MS staff and a few invited partners. Due to bad information I was the only guest attending to a VIP party with the dev team during that conference 🙂Regards,
Lars-Eric
msdn9Can you tell me how you made it work for word an excell?
I have developed an MS Office 2010 Backstage UI using this tutorial
http://msdn.microsoft.com/en-us/library/ff936212.aspx#Y1168
The only changes that I made in my code was, in the wizard of Shared-Add-ins I selected all so that this works with all MS Office Application not just word. But its only working with MS Word, not rest of the application. How can I make it work with rest of MS Office Applications too??
msdn10Hello Adeel,
Sorry for the late reply, I’m on vacation for the moment so not by a computer so often.
In my examples I modified the backstage on document level in Word and Excel, not an add-in.
Perhaps someone else working with add-ins can give you a clue about how to solve your problem.
Regards,
Lars-Eric
msdn11How do you modify in document level?
msdn12