Back to Devexpress

WorkbookTheme.Load(String) Method

officefileapi-devexpress-dot-spreadsheet-dot-workbooktheme-dot-load-x28-system-dot-string-x29.md

latest2.3 KB
Original Source

WorkbookTheme.Load(String) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Loads a custom theme from a THMX file and applies it to the document.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Load(
    string fileName
)
vb
Sub Load(
    fileName As String
)

Parameters

NameTypeDescription
fileNameString

A path to the THMX file that contains a theme definition.

|

Remarks

In Microsoft® Excel®, you can save a document theme as a .thmx file to reuse this theme in other documents. Refer to the following topic for details: Save a Custom Theme for Reuse. The WorkbookTheme.Load method allows you to load a file with a custom theme and to apply it to your workbook.

The following code snippet applies the Quotable theme to the document:

csharp
using DevExpress.Spreadsheet;
// ...

WorkbookTheme docTheme = workbook.Theme;
docTheme.Load(@"CustomThemes\Quotable.thmx");
vb
Imports DevExpress.Spreadsheet
' ...

Dim docTheme As WorkbookTheme = workbook.Theme
docTheme.Load("CustomThemes\Quotable.thmx")

See Also

WorkbookTheme Interface

WorkbookTheme Members

DevExpress.Spreadsheet Namespace