Share via


Document.ActiveThemeDisplayName Property (2007 System)

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

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

Syntax

'Declaration
Public ReadOnly Property ActiveThemeDisplayName As String
'Usage
Dim instance As Document 
Dim value As String 

value = instance.ActiveThemeDisplayName
public string ActiveThemeDisplayName { get; }
public:
property String^ ActiveThemeDisplayName {
    String^ get ();
}
public function get ActiveThemeDisplayName () : String

Property Value

Type: System.String
The display name of the active theme for the document.

Remarks

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.

Examples

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.

This example is for a document-level customization.

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 Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace