DocumentBase.ActiveTheme 属性

定义

获取文档的活动主题名称以及主题格式设置选项。

public string ActiveTheme { get; }

属性值

String

文档的活动主题名称以及主题格式设置选项。

示例

下面的代码示例将一个名为 "下午" 的主题应用于文档,然后显示一条消息,显示活动主题的名称。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

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

注解

如果文档没有活动主题,此属性将返回 "none"。

有关此属性返回的值的说明,请参见方法的 Name 参数 ApplyTheme 。 此属性返回的值可能不对应于主题的显示名称。 若要返回主题的显示名称,请使用 ActiveThemeDisplayName 属性。

适用于