Udostępnij za pośrednictwem


DocumentBase.SmartTags Property

Gets a SmartTags object that represents a smart tag in a document.

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

Syntax

'Declaration
Public ReadOnly Property SmartTags As SmartTags
    Get
public SmartTags SmartTags { get; }

Property Value

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

Examples

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 Sub DocumentSmartTags()
    Dim index As Object = 1
    If Me.SmartTags.Count >= 1 Then
        Me.SmartTags.Item(index).Properties.Add("President", "true")
    End If
End Sub 
private void DocumentSmartTags()
{
    object index = 1;
    if (this.SmartTags.Count >= 1)
    {
        this.SmartTags.get_Item(ref index)
            .Properties.Add("President", "true");
    }
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace