Initializes the ribbon in a single call with XML.

Syntax

Error = Send_Message(Ctrl, "OLE.Init", XmlData)

Parameters

PropertyDescription
XmlDataThe XML snippet used to initialize this control.

Returns

An XML parsing error, or "" if the XML parsed successfully. (Added in 4.1.20)

Remarks

The Init method is a fast and convenient way to initialize the ribbon. The ribbon consists of many elements in a hierarchical relationship--lots of parents and children. With such complexity, using lots of properties and methods to initialize the control is confusing and prone to error. XML provides a nice way to handle the complex relationships without sacrificing clarity.

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 <Control> element. Each XML element is documented on the wiki, but you'll want to start with the <Control> element and work your way down.

NOTE: As of 4.0.2, you can call this method multiple times as long as you call the Clear method before each Init method. If you need to add new elements without clearing first, see the AddControlsAddGroups, and AddTabs methods.

Example

// Read the XML from a table and pass it to the Init method
SetupXml = Xlate("SETUP", "MY_RIBBON_SETUP_XML", "", "X")
Send_Message(@Window:".OLE_RIBBON", "OLE.Init", SetupXml)

See Also

<Control>AddControlsAddGroupsAddTabs

  • No labels