Syntax

expression.Tag

expression An expression that returns a IRibbonControl object.

Return Value
String

Remarks

Normally you can distinguish between controls in a Ribbon user interface XML customization file using the Id property. However, there are restrictions on what IDs can contain (no non-alphanumeric characters, and they must all be unique). The Tag property doesn't have these restrictions and so it can be used in the following situations, where ID doesn't work:

Example

In the XML used to customize the Ribbon user interface, you can set a tag as follows. When the MyFunction action is called, you can read the Tag property, which will be equal to "some string".

XML
<button id="mybutton" tag="some string" onAction="MyFunction"/>

See also: