Condividi tramite


Proprietà DocumentBase.ActiveTheme

Ottiene il nome del tema attivo più le relative opzioni di formattazione per il documento.

Spazio dei nomi:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property ActiveTheme As String
    Get
public string ActiveTheme { get; }

Valore proprietà

Tipo: System.String
Nome del tema attivo più le relative opzioni di formattazione per il documento.

Note

La proprietà restituisce "none" se il documento non dispone di un tema attivo.

Per una spiegazione del valore restituito dalla proprietà vedere l'argomento Name del metodo ApplyTheme. Il valore restituito dalla proprietà potrebbe non corrispondere al nome visualizzato del tema. Per restituire il nome visualizzato di un tema utilizzare la proprietà ActiveThemeDisplayName.

Esempi

Nell'esempio di codice riportato di seguito viene illustrato come applicare al documento un tema denominato Afternoon e come visualizzare un messaggio riportante il nome del tema attivo. Per utilizzare questo esempio, eseguirlo dalla classe ThisDocument in un progetto a livello di documento.

    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 + ".");
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

DocumentBase Classe

Spazio dei nomi Microsoft.Office.Tools.Word