Tags Property

Applies To

Presentation object, Shape object, ShapeRange collection object, Slide object, SlideRange collection object.

Description

Returns a Tags object that represents the tags for the specified object. Read-only.

See Also

CustomDocumentProperties property.

Example

This example adds a tag named "Region" and a tag named "Priority" to slide one in the active presentation.

With Application.ActivePresentation.Slides(1).Tags
    .Add "Region", "East"        'Adds "Region" tag with value "East"
    .Add "Priority", "Low"       'Adds "Priority" tag with value "Low"
End With
This example searches through the tags for each slide in the active presentation. If there's a tag named "Priority," a message box displays the tag value. If the object doesn't have a tag named "Priority," the example adds this tag with the value "Unknown."

For Each s In Application.ActivePresentation.Slides
    With s.Tags
        found = False
        For i = 1 To .Count
            If .Name(i) = "Priority" Then
                found = True
                slNum = .Parent.SlideIndex
                MsgBox "Slide " & slNum & " priority: " & .Value(i)
        End If
        Next
        If Not found Then
            slNum = .Parent.SlideIndex
            .Add "Priority", "Unknown"
            MsgBox "Slide " & slNum & " priority tag added: Unknown"
        End If
    End With
Next