DocumentBase.ActiveThemeDisplayName 屬性

取得文件現用主題的顯示名稱。

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

語法

'宣告
Public ReadOnly Property ActiveThemeDisplayName As String
    Get
public string ActiveThemeDisplayName { get; }

屬性值

型別:System.String
文件現用主題的顯示名稱。

備註

如果文件沒有現用主題,此屬性就會傳回 "none"。

主題的顯示名稱是在 [主題] 對話方塊中出現的名稱。 此名稱可能不會對應到您用於設定預設主題或將主題套用至文件的字串。

範例

下列程式碼範例會將名為 Afternoon 的主題套用至文件,然後顯示表示現用主題名稱的訊息。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

    Private Sub DocumentActiveTheme()
        Me.ApplyTheme("AFTRNOON 011")
        MessageBox.Show("The " & Me.ActiveTheme.ToString() & " theme has been" _
            & " applied to this document." & vbLf & "The display name is " _
            & Me.ActiveThemeDisplayName & ".")
    End Sub

private void DocumentActiveTheme()
{
    this.ApplyTheme("AFTRNOON 011");
    MessageBox.Show ("The " + this.ActiveTheme.ToString() + " theme has been"
        + " applied to this document." + "\n" + "The display name is " 
        + this.ActiveThemeDisplayName + ".");
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間