Tags.Add method (Publisher)
Adds a new Tag object to the specified Tags collection and returns the new Tag object.
Syntax
expression.Add (Name, Value)
expression A variable that represents a Tags object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Name | Required | String | The name of the tag to add. If a tag already exists with the same name, an error occurs. |
Value | Required | Variant | The value to assign to the tag. |
Return value
Tag
Example
The following example adds a tag to shape one on page one of the active publication.
Dim tagNew As Tag
Set tagNew = ActiveDocument.Pages(1).Shapes(1).Tags _
.Add(Name:="required", Value:="yes")
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.