Share via


DocumentBase.SmartTags 屬性

取得 SmartTags 物件,表示文件中的智慧標籤。 這個類型或成員僅適用於 2007 Microsoft Office system 專案。智慧標籤在 Office 2010 中已被取代。
.

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property SmartTags As SmartTags
public SmartTags SmartTags { get; }

屬性值

型別:Microsoft.Office.Interop.Word.SmartTags
SmartTags 物件,表示文件中的智慧標籤。

範例

下列程式碼範例會將屬性加入至文件中的第一個智慧標籤。 此範例會假設文件中有智慧標籤。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

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 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間