Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The AddGroups method allows you to add new groups to the ribbon at runtime. This is the only way to add new groups. Do not call Init multiple times.

To use this method, pass a string containing XML. It does not matter where the XML was originally stored. All that matters is that the one parameter you pass contains XML with one <AddGroups> element. Each XML element is documented on the wiki, but you'll want to start with the <AddGroups> element and work your way down.

...

Code Block
Xml  = ''
Xml := '<AddGroups>'
Xml := '  <Tab Key="HOME">'
Xml := '    <Group Key="NAVIGATE" Caption="Navigation" OptionButton="true">'
Xml := '      <Button Key="BTN_UP" BeginGroup="true">'
Xml := '        <Command Key="UP" Caption="Up" Shortcut="Alt+Up" SmallIcon="Icons\arrow_up.png" />'
Xml := '      </Button>'
Xml := '      <Button Key="BTN_DOWN">'
Xml := '        <Command Key="DOWN" Caption="Down" Shortcut="Alt+Down" SmallIcon="Icons\arrow_down.png" />'
Xml := '      </Button>'
Xml := '      <Button Key="BTN_LEFT">'
Xml := '        <Command Key="LEFT" Caption="Left" Shortcut="Alt+Left" SmallIcon="Icons\arrow_left.png" />'
Xml := '      </Button>'
Xml := '      <Button Key="BTN_RIGHT">'
Xml := '        <Command Key="RIGHT" Caption="Right" Shortcut="Alt+Left" SmallIcon="Icons\arrow_left.png" />'
Xml := '      </Button>'
Xml := '    </Group>'
Xml := '  </Tab>'
Xml := '  <Tab Key="INSERT">'
Xml := '    <Group Key="PAGES" Caption="Pages" />'
Xml := '    <Group Key="TABLES" Caption="Tables" />'
Xml := '    <Group Key="ILLUSTRATIONS" Caption="Illustrations" />'
Xml := '    <Group Key="APPS" Caption="Apps" />'
Xml := '    <Group Key="MEDIA" Caption="Media" />'
Xml := '    <Group Key="LINKS" Caption="Links" />'
Xml := '    <Group Key="COMMENTS" Caption="Comments" />'
Xml := '    <Group Key="HEADERFOOTER" Caption="Header & Footer" />'
Xml := '    <Group Key="TEXT" Caption="Text" />'
Xml := '    <Group Key="SYMBOLS" Caption="Symbols" />'
Xml := '  </Tab>'
Xml := '</AddGroups>'
   
Send_Message(@Window:".OLE_RIBBON", "OLE.AddGroups", Xml)

See Also

RemoveGroups<AddGroups>