Table of contents
Collapse the table of content
Expand the table of content

Tags.Add Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Adds a new Tag object to the specified Tags object and returns the new Tag object.


expression. Add( Name, Value)

_expression_A variable that represents a Tags object.


NameRequired/OptionalData TypeDescription
NameRequiredStringThe name of the tag to add. If a tag already exists with the same name, an error occurs.
ValueRequiredVariantThe value to assign to the tag.

Return Value



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")
© 2018 Microsoft