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)
Syntax
'Declaration
Public Sub ApplyDocumentTheme ( _
fileName As String _
)
public void ApplyDocumentTheme(
string fileName
)
Parameters
fileName
Type: System.StringThe 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 Sub SwitchToFoundryTheme()
Me.ApplyDocumentTheme("C:\Program Files\Microsoft Office\" + _
"Document Themes 12\Foundry.thmx")
End Sub
private void SwitchToFoundryTheme()
{
this.ApplyDocumentTheme(@"C:\Program Files\Microsoft Office\" +
@"Document Themes 12\Foundry.thmx");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.