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

Shape.Tags Property (Publisher)

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

Returns a Tags collection representing tags or custom properties applied to a shape, shape range, page, or publication.


expression. Tags

_expression_A variable that represents a Shape object.


This example adds a tag to each oval shape on the first page of the active publication.

Dim shp As Shape 
Dim tagsAll As Tags 
Dim tagLoop As Tag 
Dim blnTag As Boolean 

With ActiveDocument.Pages(1) 
 For Each shp In .Shapes 
 If shp.AutoShapeType = msoShapeOval Then 
 Set tagsAll = shp.Tags 
 blnTag = False 

 For Each tagLoop In tagsAll 
 If tagLoop.Name = "Shape" Then 
 blnTag = True 
 Exit For 
 End If 
 Next tagLoop 

 If blnTag = False Then 
 tagsAll.Add Name:="Shape", Value:="Oval" 
 End If 
 End If 
 Next shp 
End With 
© 2018 Microsoft