{"id":3676,"date":"2014-03-29T07:48:49","date_gmt":"2014-03-29T07:48:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/office-2010-backstage-ui-problem-in-both-word-and-excel-collection-of-common-programming-errors\/"},"modified":"2014-03-29T07:48:49","modified_gmt":"2014-03-29T07:48:49","slug":"office-2010-backstage-ui-problem-in-both-word-and-excel-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/office-2010-backstage-ui-problem-in-both-word-and-excel-collection-of-common-programming-errors\/","title":{"rendered":"Office 2010 Backstage UI problem in both Word and Excel-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<\/p>\n<p>I 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.<\/p>\n<p>This is &#8216;no problem&#8217; when using the onShow attribute in the XML:<\/p>\n<p>\u00a0<\/p>\n<p>In the OnShow() callback I invalidate the Backstage and it works fine, BUT&#8230;. If I open another document (not a\u00a0macro 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.<\/p>\n<p>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.<\/p>\n<p>I hope someone can help me as this is becoming a showstopper. You can&#8217;t tell the customer to\u00a0 have only one document open at a time.<\/p>\n<p>Regards,<br \/>\nLars-Eric<\/p>\n<\/li>\n<li>\n<h3>12 Answers<\/h3>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn1<\/p>\n<p>Hi,<\/p>\n<p>Unfortunately, the backstage onShow property will only work correctly when the callback macro that\u2019s fired is available globally for each Word document &#8211; 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.)<\/p>\n<p>Regards,<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn2<\/p>\n<p>Hi Lars-Eric,<\/p>\n<p>Thanks for your reply.<\/p>\n<p>I\u2019ll 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 \u201c\u2026 macro cannot be found \u2026\u201d error when a different file without the callback code is active, with the Office development team as a scenario to be supported.<\/p>\n<p>Thus, you don\u2019t need to open a support case to get the issue to our development group.<\/p>\n<p>Regards,<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn3<\/p>\n<p>Hi Lasr-Eric,<\/p>\n<p>Thank you for your steps and I have reproduced this scenario.<\/p>\n<p>But I am not sure whether this is a issue or by design. I will involve someone who are more familiar about this.<\/p>\n<p>Best Regards,<\/p>\n<p>Bruce Song [MSFT]<br \/>\nMSDN Community Support | Feedback to us<br \/>\nGet 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.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/bit.ly\/dHDhlK?a.png\" \/><\/p>\n<p><\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn4<\/p>\n<p>Hello Bruce and thanks for your reply.<\/p>\n<p>For me this is a serious issue. I have very hard to understand a design that generates runtime errors that you can&#8217;t catch. I think nobody at this forum want to deliver solutions to customers that generates runtime errors out of control\u00a0like this. We have customers from small to consulting companies to big healthcare administrations and big companies like IBM and\u00a0GE Capital. It would not look serious to deliver solutions that generates runtime errors, like this,\u00a0out of my control.<\/p>\n<p>I really think, and hope, it&#8217;s just a\u00a0design issue, something they didn&#8217;t think about when they designed the Backstage. You can even find examples on MSDN using exactly this technology and I don&#8217;t think those examples are\u00a0intended to generate runtime errors with no control from the developers side.<\/p>\n<p>Regards,<br \/>\nLars-Eric<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn5<\/p>\n<p>Hi,<\/p>\n<p>Unfortunately, the backstage onShow property will only work correctly when the callback macro that\u2019s fired is available globally for each Word document &#8211; 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.)<\/p>\n<p>Regards,<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn6<\/p>\n<p>Helli Bill,<\/p>\n<p>Thanks for looking into this.<\/p>\n<p>I think this shoud be an enhancement request. We can&#8217;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.\u00a0We have another issue about the &#8216;sandbox&#8217; mode that we had a support case about and\u00a0is now filed as a bug.<\/p>\n<p>If you have no possibility to make this as an enhancemant request we will concider open a support case again\u00a0and try to\u00a0report 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.<\/p>\n<p>Regards,<br \/>\nLars-Eric<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn7<\/p>\n<p>Hi Lars-Eric,<\/p>\n<p>Thanks for your reply.<\/p>\n<p>I\u2019ll 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 \u201c\u2026 macro cannot be found \u2026\u201d error when a different file without the callback code is active, with the Office development team as a scenario to be supported.<\/p>\n<p>Thus, you don\u2019t need to open a support case to get the issue to our development group.<\/p>\n<p>Regards,<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn8<\/p>\n<p>Hello Bill,<\/p>\n<p>Thank you very much for your assistance. I really appreciate you forward this issue to the development team.<br \/>\nI have met the dev team ones in Seattle\u00a0on\u00a0a MS conference\u00a0for\u00a0MS 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 \ud83d\ude42<\/p>\n<p>Regards,<br \/>\nLars-Eric<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn9<\/p>\n<p>Can you tell me how you made it work for word an excell?<\/p>\n<p>I have developed an MS Office 2010 Backstage UI using this tutorial<\/p>\n<p>http:\/\/msdn.microsoft.com\/en-us\/library\/ff936212.aspx#Y1168<\/p>\n<p>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??<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn10<\/p>\n<p>Hello Adeel,<\/p>\n<p>Sorry for the late reply, I&#8217;m on vacation for the moment so not by a computer so often.<\/p>\n<p>In my examples I modified the backstage on document level in Word and Excel, not an add-in.<\/p>\n<p>Perhaps someone else working with add-ins can give you a clue about how to solve your problem.<\/p>\n<p>Regards,<br \/>\nLars-Eric<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn11<\/p>\n<p>How do you modify in document level?<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn12<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>msdn I 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 &#8216;no problem&#8217; when using the onShow attribute in the XML: \u00a0 In the OnShow() callback I invalidate the Backstage and it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3676","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3676"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3676\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}