Collapse the table of content
Expand the table of content
Expand Minimize

DocumentBase.ApplyDocumentTheme Method

Applies a document theme to a document.

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

public void ApplyDocumentTheme(
	string fileName
)

Parameters

fileName
Type: System.String

The full path of the theme to apply.

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft