none
Intercept Backstage OnShow only seems to fire once RRS feed

  • Question

  • Hello,

    I'm testing out intercepting the backstage onshow event, and it appears to work, but only once.  In particular, I have a custom ribbon for composing and reading emails.  For each of these custom ribbons, when one clicks on the file-> I want to intercept and "do stuff" with the email.  I seem to be able to intercept it once, but if someone selects another tab, then goes back to the file-> it doesn't appear to be called again.  Is there some trick to get the event each time?

    Chris



    Chris Finlayson

    Thursday, March 24, 2016 8:49 PM

Answers

  • >>>I'm testing out intercepting the backstage onshow event, and it appears to work, but only once.  In particular, I have a custom ribbon for composing and reading emails.  For each of these custom ribbons, when one clicks on the file-> I want to intercept and "do stuff" with the email.  I seem to be able to intercept it once, but if someone selects another tab, then goes back to the file-> it doesn't appear to be called again.  Is there some trick to get the event each time?<<<

    According to your description, I have made a sample to try to reproduce this issue, unfortunately, I can't.

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <backstage onShow="OnShow">
      </backstage>
    </customUI>


    public void OnShow(object contextObject)
    {
        System.Windows.Forms.MessageBox.Show("Test");
    }

    So I suggest that you could provide more information about your issue, for example sample code, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    • Marked as answer by C. Finlayson Friday, March 25, 2016 5:12 PM
    Friday, March 25, 2016 2:26 AM

All replies

  • >>>I'm testing out intercepting the backstage onshow event, and it appears to work, but only once.  In particular, I have a custom ribbon for composing and reading emails.  For each of these custom ribbons, when one clicks on the file-> I want to intercept and "do stuff" with the email.  I seem to be able to intercept it once, but if someone selects another tab, then goes back to the file-> it doesn't appear to be called again.  Is there some trick to get the event each time?<<<

    According to your description, I have made a sample to try to reproduce this issue, unfortunately, I can't.

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <backstage onShow="OnShow">
      </backstage>
    </customUI>


    public void OnShow(object contextObject)
    {
        System.Windows.Forms.MessageBox.Show("Test");
    }

    So I suggest that you could provide more information about your issue, for example sample code, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    • Marked as answer by C. Finlayson Friday, March 25, 2016 5:12 PM
    Friday, March 25, 2016 2:26 AM
  • Hello Chris,

    What ribbon XML markup do you use for customizing the Fluent UI? What code do you have in the onShow callback?

    Read more about the Backstage UI in the following articles in MSDN:

    Introduction to the Office 2010 Backstage View for Developers

    Customizing the Office 2010 Backstage View for Developers

    Friday, March 25, 2016 7:56 AM
  • Thanks - it does work!

    Chris Finlayson

    Friday, March 25, 2016 5:12 PM