DocumentBase.SmartTags Property

Gets a SmartTags object that represents a smart tag in a document. This type or member is intended to be used only in projects for the 2007 Microsoft Office system. Smart tags are deprecated in Office 2010. .

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public SmartTags SmartTags { get; }

Property Value

Type: Microsoft.Office.Interop.Word.SmartTags
A SmartTags object that represents a smart tag in a document.

The following code example adds properties to the first smart tag in the document. This example assumes that a smart tag exists in the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentSmartTags()
{
    object index = 1;
    if (this.SmartTags.Count >= 1)
    {
        this.SmartTags.get_Item(ref index)
            .Properties.Add("President", "true");
    }
}

Show: