none
Office Ribbon: Dynamic menu inside backstage view RRS feed

  • Question

  • Hi Guys

    I want to display some dynamic list on Ribbon. I am using custom Ribbon (XML) and 'getcontent' attribute of 'dynamicmenu'

    I need to make similar task inside 'backstage' control and I can't find 'dynamicmenu' here.

    Does this dynamic menu avaliable here if no what might be solution?

    Thanks

    Monday, September 24, 2012 5:27 PM

Answers

  • Hi Andrey

    Sorry for being so distracted today, I'm busy working on something else...

    A dropdown (or combobox) CAN be dynamic. Absolutely. They have the same attributes as a Gallery that make it possible: getItemCount, getItemID, getItemLabel

    And yes, the approach with using .Visible/.Enabled will also work, but I didn't want to suggest that until all other possibilities were exhausted :-)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Andrey Chernov Wednesday, September 26, 2012 7:08 AM
    Tuesday, September 25, 2012 3:42 PM
    Moderator

All replies

  • by right clicking on the toolbar choose customize the ribbon option.

    Monday, September 24, 2012 7:31 PM
  • I am doing it programmatically via VSTO
    Tuesday, September 25, 2012 8:08 AM
  • Hi Andrey

    I'm looking at the article "Introduction to the Office 2010 Backstage View for Developers". All the controls available are listed there (alphabetically) and dynamicMenu (note the capitalization! Could this be your problem?) is in the list. And it has a getContent attribute: the method signatures for the various programming languages include VBA, VB.NET, C# and C++.

    What do you mean by "inside 'backstage' control"?


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, September 25, 2012 8:31 AM
    Moderator
  • Yes dynamicmenu is here but only 'contextMenu' control can have this dynamicmenu as child control.

    Any another controls from this site can't have dynamicmenu as child. Am I correct?

    >What do you mean by "inside 'backstage' control"?

    I mean that I am creating Ribbon (XML) and write something like this:

    <backstage>

        <tab><firstColumn><group><primaryItem>

         somewhere here I want to make like:

       <dynamicMenu></dinamicMenu>

       </primaryItem></group></firstColumn></tab>

    </backstage>

    Because now I have backstage view and simple menu inside but this menu does not allow to add items dynamically.

    Tuesday, September 25, 2012 9:39 AM
  • There is one more solution for this issue but anyway I can't implement it.

    In Word, Excel, PowerPoint there are recent items and looks like this list is dynamic.

    How can I implement something similar?

    Tuesday, September 25, 2012 10:13 AM
  • Hi Andrey

    Right, I see what you're saying...

    There's an event that's triggered when the Backstage is called up by the User (when File is clicked), onShow. In the callback for this event you can dynamically change the content of what backstage shows through the various "get" attributes for the controls.

    Edit: I just realized my answer isn't really complete :-) onShow is an attribute for the backstage element. In that callback you can invalidate the Ribbon so that the elements re-evaluate these callbacks. See "Customizing the Office 2010 Backstage View for Developers".


    Cindy Meister, VSTO/Word MVP, my blog


    Tuesday, September 25, 2012 12:31 PM
    Moderator
  • Yes I can invalidate the Ribbon and re-evaluate content that is already exists on backstage view but I can't add new controls.

    See original/root message: 'I want to display some dynamic list' so I need to add new controls/items to parent control/menu

    Anyway thanks for replying.

    It looks to me what I am trying to do is a restriction of backstage view (

    Tuesday, September 25, 2012 12:54 PM
  • But you could use a Gallery like a menu? Just set it up to have one column, small buttons, etc... That's probably better than a Dropdown, but that would also be a possibility.

    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, September 25, 2012 2:36 PM
    Moderator
  • No I can't.

    1. It seems Gallery only accessible only like child of 'conextMenu'

    http://msdn.microsoft.com/en-us/library/office/ee691833.aspx

    2. Gallery like combobox and like dropdown has only static content/items that are hard coded to XML

    we only can re-evaluate these specific item and can't add new ones

    But... I have one idea and will try tomorrow to implement it.

    Idea is:

    We know max count of items so I can add to XML this max number of items and make visible (set label, description etc.) only items we need to display and hide all other.

    Tuesday, September 25, 2012 3:14 PM
  • Hi Andrey

    Sorry for being so distracted today, I'm busy working on something else...

    A dropdown (or combobox) CAN be dynamic. Absolutely. They have the same attributes as a Gallery that make it possible: getItemCount, getItemID, getItemLabel

    And yes, the approach with using .Visible/.Enabled will also work, but I didn't want to suggest that until all other possibilities were exhausted :-)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Andrey Chernov Wednesday, September 26, 2012 7:08 AM
    Tuesday, September 25, 2012 3:42 PM
    Moderator
  • Yes. It is possible with dropdown/combobox. I understood API of dropdown/combobox in wrong way ( I expected to have one method that fill in items and will be called once. Instead of that 'getItemLabel' is called getItemCount times.

    And visible/invisible is like solution with menu.

    I think the question is closed )

    Thank you Cindy.

    Wednesday, September 26, 2012 7:07 AM