Share via


Tags.Add Method

Publisher Developer Reference

Adds a new Tag object to the specified Tags object 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.

Visual Basic for Applications
  Dim tagNew As Tag

Set tagNew = ActiveDocument.Pages(1).Shapes(1).Tags _ .Add(Name:="required", Value:="yes")

See Also