SmartTags Collection

Word Developer Reference

A collection of SmartTag objects that represents the text in a document that is marked as containing recognized type information.

Remarks

The SmartTags collection contains all the smart tags in a document or range of text within a document. Microsoft Word uses a recognizer file to label smart tags, and it uses an action file to execute actions related to the smart tags, such as linking to Web sites.

Use the Item method — or SmartTags(Index), where Index represents the number of the smart tag — to return a single SmartTag object. This example adds custom properties to the first smart tag in the active document.

Visual Basic for Applications
  Sub NewSmartTagProp()
    ActiveDocument.SmartTags(1).Properties _
        .Add Name:="President", Value:=True
End Sub

See Also