DocumentBase.ApplyDocumentTheme(String) Method

Definition

Applies a document theme to a document.

public:
 void ApplyDocumentTheme(System::String ^ fileName);
public void ApplyDocumentTheme (string fileName);
member this.ApplyDocumentTheme : string -> unit
Public Sub ApplyDocumentTheme (fileName As String)

Parameters

fileName
String

The full path of the theme to apply.

Examples

The following code example switches the document theme to the Foundry theme. To use this example, run it from the ThisDocument class in a document-level project.

private void SwitchToFoundryTheme()
{
    this.ApplyDocumentTheme(@"C:\Program Files\Microsoft Office\" + 
                      @"Document Themes 12\Foundry.thmx");
}
Private Sub SwitchToFoundryTheme()
    Me.ApplyDocumentTheme("C:\Program Files\Microsoft Office\" + _
                          "Document Themes 12\Foundry.thmx")
End Sub

Applies to