WorkbookBase.ApplyTheme Method

Applies the specified theme to the workbook.

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

Syntax

'Declaration
Public Sub ApplyTheme ( _
    filename As String _
)
public void ApplyTheme(
    string filename
)

Parameters

  • filename
    Type: System.String

    The full file path of the theme to apply.

Examples

The following code example switches the workbook theme to the Foundry theme.

This example is for a document-level customization.

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

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace