none
Can't Add DropDownButton to the Ribbon RRS feed

  • Question

  • Hi

    I am trying to add a drop down button and menu to the ribbon similar to the Paste button in Word

    The following xml adds a new tab and some button. Everything works fine until I add the highlighted section for mso:dropdownbutton. The tab doesn't load. I must be missing something.

    sRibbonXML = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2006/01/customui"" >" & _
      "<mso:ribbon>" & _
      "<mso:tabs>" & _
      "<mso:tab id=""CustomTab"" label=""VBM"">" & _
      "<mso:group id=""RunVBM"" >" & _
      "<mso:button id=""ButtonVBM"" label=""Run VBM"" size=""large"" onAction=""RunVBM"" getImage=""GetImage"" supertip=""Start the Advantage VBM file management system"" />" & _
      "</mso:group >" & _
      "<mso:group id=""AdvantageVBM"" label=""Advantage VBM"">"

    ' this xml for a dropdownbutton stops the new VBM tab being loaded
    sRibbonXML = sRibbonXML & _
      "<mso:dropdownbutton id=""ButtonSendMail1""label="" Send To Mail Recipient"" size=""large"" getImage=""GetImage"" >" & _
      "<mso:menugroup>" & _
       "<mso:button id=""SendHyperlink"" label=""Send As Hyperlink"" />" & _
       "<mso:button id=""SendAttachment"" label=""Send As An Attachment"" />" & _
       "<mso:button id=""SendZipAttachment"" label=""Send As A Zip Attachment"" />" & _
      "</mso:menugroup>" & _
      "</mso:dropdownbutton>"

    sRibbonXML = sRibbonXML & _
      "</mso:group >" & _
      "<mso:group id=""VBMHelp"" label=""Help"">" & _
      "<mso:button id=""ButtonHelp"" label=""VBM Help Guide"" size=""large"" onAction=""VBMHelpGuide"" getImage=""GetImage"" supertip=""Activate the Advantage VBM on-line Help Guide"" />" & _
      "</mso:group >" & _
      "</mso:tab>" & _
      "</mso:tabs>" & _
      "</mso:ribbon>" & _
      "</mso:customUI>"

    Thanks in advance


    Michael McGinty, CY Innovations Pty. Ltd. Publisher of Advantage VBM freeware www.cyinnovations.com

    Thursday, July 26, 2012 8:43 AM

Answers

  • Hi Michael

    There is no such Ribbon control as dropdownbutton.

    Perhaps if you change that to: dropDown

    you might have more luck?


    Cindy Meister, VSTO/Word MVP

    • Proposed as answer by JosephFox Thursday, July 26, 2012 9:31 AM
    • Unproposed as answer by Mike McGinty Thursday, July 26, 2012 10:02 AM
    • Marked as answer by Mike McGinty Thursday, July 26, 2012 11:37 AM
    Thursday, July 26, 2012 9:27 AM
    Moderator
  • A split button is probably what you're after.

    Edit: Cindy did answer your question...'How to emulate a paste button' is another question. You mentioned you wanted to emulate the paste button, but in the context of explaining why you want to add a DropDownButton.

    Thursday, July 26, 2012 10:37 AM

All replies

  • Hi Michael

    There is no such Ribbon control as dropdownbutton.

    Perhaps if you change that to: dropDown

    you might have more luck?


    Cindy Meister, VSTO/Word MVP

    • Proposed as answer by JosephFox Thursday, July 26, 2012 9:31 AM
    • Unproposed as answer by Mike McGinty Thursday, July 26, 2012 10:02 AM
    • Marked as answer by Mike McGinty Thursday, July 26, 2012 11:37 AM
    Thursday, July 26, 2012 9:27 AM
    Moderator
  • Thanks Cindy

    I tried mso:dropdown and it works ok however what do I use to mimic Paste drop down button on the Word Home tab?


    Michael McGinty, CY Innovations Pty. Ltd. Publisher of Advantage VBM freeware www.cyinnovations.com

    Thursday, July 26, 2012 10:01 AM
  • A split button is probably what you're after.

    Edit: Cindy did answer your question...'How to emulate a paste button' is another question. You mentioned you wanted to emulate the paste button, but in the context of explaining why you want to add a DropDownButton.

    Thursday, July 26, 2012 10:37 AM
  • Joseph

    I did try splitbutton but this prevents the VBM tab from loading as well.

    I want a button which drops down a menu when clicked. The Word Paste button is the best example of what I am after.


    Michael McGinty, CY Innovations Pty. Ltd. Publisher of Advantage VBM freeware www.cyinnovations.com


    Thursday, July 26, 2012 10:53 AM
  • Thanks Joseph/Cindy

    You were correct the splitbutton is what I needed.

    I had tried it before but couldn't get it to load. The reason was that when I copied the code from split button I should have used the mso: prefix


    Michael McGinty, CY Innovations Pty. Ltd. Publisher of Advantage VBM freeware www.cyinnovations.com

    Thursday, July 26, 2012 11:37 AM
  • Glad you got it to work.

    I'm sure other people have that issue too. I would have mentioned it, except on my version of Visual Studio the mso prefix isn't necessary; it must be the IDE setup.

    Thursday, July 26, 2012 1:38 PM