DocumentBase.ActiveThemeDisplayName Property

 

Gets the display name of the active theme for the document.

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

public string ActiveThemeDisplayName { get; }

Property Value

Type: System.String

The display name of the active theme for the document.

This property returns "none" if the document does not have an active theme.

A theme's display name is the name that appears in the Theme dialog box. This name might not correspond to the string you would use to set a default theme or to apply a theme to a document.

The following code example applies a theme called Afternoon to the document and then displays a message that shows the name of the active theme. To use this example, run it from the ThisDocument class in a document-level project.

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 + ".");
}
Return to top
Show: