Skip to main content

tab Element

This element specifies a ribbon tab control.

For example, the following XML fragment specifies a custom tab with the id "MyTab" and label "My Custom Tab".

<tab id="MyTab" label="My Custom Tab">
	<!-- your ribbon controls here -->
</tab>

Parent Elements

Child Elements

getKeytip (getKeytip callback)

Specifies the name of a callback function to be called to determine the suggested KeyTip of this control.

The getKeytip and keytip attributes are mutually exclusive. If neither attribute is specified, the application SHOULD generate a KeyTip for the control automatically.

For example, consider the following XML fragment:

<button id="button" getKeytip="GetButtonKeytip" />

In this example, the GetButtonKeytip callback function is called when the application needs to determine the KeyTip of the button.

getLabel (getLabel callback)

Specifies the name of a callback function to be called to determine the label of this control.

The getLabel and label attributes are mutually exclusive. If neither attribute is specified, no label SHOULD be displayed.

For example, consider the following XML fragment:

<button id="button" getLabel="GetButtonLabel" />

In this example, the GetButtonLabel callback function is called when the application needs to determine the label of the button.

getVisible (getVisible callback)

Specifies the name of a callback function to be called to determine the visibility state of this control.

The getVisible and visible attributes are mutually exclusive. If neither attribute is specified, the control SHOULD default to being visible.

For example, consider the following XML fragment:

<button id="button" getVisible="IsButtonVisible" />

In this example, the IsButtonVisible callback function is called when the application needs to determine the visibility of the button.

id (control identifier)

Specifies the identifier for a custom control. All custom controls MUST have unique identifiers. The identifier of a control SHOULD be passed to callback functions to identify which control corresponds to the function call.

The ididQ, and idMso attributes are mutually exclusive. At least one of these attributes MUST be specified.

For example, consider the following XML fragment:

<tab id="customTab" label="Custom Tab">

This specifies a custom tab control with an identifier of "customTab".

idMso (built-in control identifier)

Specifies the identifier of a built-in control. The contents of this attribute are application-defined.

The ididQ, and idMso attributes are mutually exclusive. At least one of these attributes MUST be specified.

idMSO Full List in Excel for Windows

idMSO Full List in Excel for Mac

For example, consider the following XML fragment:

<control idMso="Bold" />

This creates a clone of the control with an identifier of "Bold".

idQ (qualified control identifier)

Specifies a qualified identifier for a control.

The idQ attribute can be used to reference controls or containers created by other Custom UI documents.

The ididQ, and idMso attributes are mutually exclusive. At least one of these attributes MUST be specified.

For example, consider the following XML fragment:

<customUI
    xmlns="http://schemas.microsoft.com/office/2006/01/customui"
    xmlns:ex="http://www.example.com">
    <ribbon>
      <tabs>
       <tab idQ="ex:OtherTab" label="Shared Tab">
          <group id="MyGroup" label="My Group">
            …
          </group>
        </tab>
      </tabs>
    </ribbon>
</customUI>

In this case, ex is an XML namespace prefix for the namespace http://www.example.com. This XML fragment refers to a tab in that namespace with an identifier of "OtherTab". If that tab cannot be found, it is created. A new group belonging to this file is added to the tab.

insertAfterMso (identifier of built-in control to insert after)

Specifies the identifier of a built-in control that this control SHOULD be inserted after. If the value of this attribute is not understood, it SHOULD be ignored.

The insertAfterMsoinsertAfterQinsertBeforeMso, and insertBeforeQ attributes are mutually exclusive. If none of these attributes are specified, the controls SHOULD be appended to the existing set of controls, in the order they are defined in the XML.

For example, consider the following XML fragment:

<tab id="MyTab" insertAfterMso="TabHome" label="Custom Tab">
    …
</tab>

In this example, a new custom tab with an identifier of "MyTab" is to be inserted after the built-in tab with an identifier of "TabHome".

insertAfterQ (qualified identifier of control to insert after)

Specifies the qualified identifier of a control that this control SHOULD be inserted after. If the value of this attribute is not understood, it SHOULD be ignored.

The insertAfterMsoinsertAfterQinsertBeforeMso, and insertBeforeQ attributes are mutually exclusive. If none of these attributes are specified, the controls SHOULD be appended to the existing set of controls, in the order they are defined in the XML.

For example, consider the following XML fragment:

<tab id="MyTab" insertAfterQ="x:OtherTab" label="Custom Tab">
    …
</tab>

In this example, a new custom tab with an identifier of "MyTab" is to be inserted after the custom tab with a qualified identifier of "x:OtherTab".

insertBeforeMso (identifier of built-in control to insert before)

Specifies the identifier of a built-in control that this control SHOULD be inserted before. If the value of this attribute is not understood, it SHOULD be ignored.

The insertAfterMsoinsertAfterQinsertBeforeMso, and insertBeforeQ attributes are mutually exclusive. If none of these attributes are specified, the controls SHOULD be appended to the existing set of controls, in the order they are defined in the XML.

For example, consider the following XML fragment:

<tab id="MyTab" insertBeforeMso="TabHome" label="Custom Tab">
    …
</tab>

In this example, a new custom tab with an identifier of "MyTab" is to be inserted before the built-in tab with an identifier of "TabHome".

insertBeforeQ (qualified identifier of control to insert before)

Specifies the qualified identifier of a control that this control SHOULD be inserted before. If the value of this attribute is not understood, it SHOULD be ignored.

The insertAfterMsoinsertAfterQinsertBeforeMso, and insertBeforeQ attributes are mutually exclusive. If none of these attributes are specified, the controls SHOULD be appended to the existing set of controls, in the order they are defined in the XML.

For example, consider the following XML fragment:

<tab id="MyTab" insertBeforeQ="x:OtherTab" label="Custom Tab">
     …
</tab>

In this example, a new custom tab with an identifier of "MyTab" is to be inserted before the custom tab with a qualified identifier of "x:OtherTab".

keytip (keytip)

Specifies a string to be used as the suggested KeyTip for this control.

The keytip and getKeytip attributes are mutually exclusive. If neither attribute is specified, the application SHOULD generate a KeyTip for the control automatically.

For example, consider a tab with KeyTip 'CT', as follows:


This is specified using the following XML fragment:

<tab id="customTab" label="Custom Tab" keytip="CT" insertBeforeMso="TabHome">

label (label)

Specifies a string to be used as the label for this control.

The label and getLabel attributes are mutually exclusive. If neither attribute is specified, no label SHOULD be displayed.

For example, consider the following XML fragment:

<tab id="customTab" label="Custom Tab">

This specifies a custom tab with a label of "Custom Tab".

tag (tag)

Specifies an arbitrary string that can be used to hold data or identify the control. The contents of this attribute SHOULD be passed to any callback functions specified on this control.

If this attribute is omitted, the control's tag value SHOULD default to an empty string.

For example, consider the following XML fragment:

<button id="button" label="Button" tag="123456" onAction="ButtonClicked" />

This specifies a button with a tag value of "123456", which is passed to the ButtonClicked callback function.

visible (control visibility)

Specifies the visibility state of the control.

The getVisible and visible attributes are mutually exclusive. If these attributes are omitted, the control SHOULD default to being visible.

For example, consider the following XML fragment:

<tab idMso="TabHome" visible="false" />

In this example, the built-in tab with an identifier of "TabHome" is hidden.

The possible values for this attribute are defined by the XML schema boolean datatype.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>