Back to Devexpress

Workbook.LoadDocumentProperties(String, DocumentFormat) Method

officefileapi-devexpress-dot-spreadsheet-dot-workbook-dot-loaddocumentproperties-x28-system-dot-string-devexpress-dot-spreadsheet-dot-documentformat-x29.md

latest2.9 KB
Original Source

Workbook.LoadDocumentProperties(String, DocumentFormat) 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 document properties from the specified workbook.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public ReadOnlyDocumentProperties LoadDocumentProperties(
    string fileName,
    DocumentFormat format
)
vb
Public Function LoadDocumentProperties(
    fileName As String,
    format As DocumentFormat
) As ReadOnlyDocumentProperties

Parameters

NameTypeDescription
fileNameString

The path to the target file.

| | format | DocumentFormat |

An enumeration member that defines the document format.

|

Returns

TypeDescription
ReadOnlyDocumentProperties

An object that stores the retrieved document properties.

|

Remarks

Use this method to load document metadata (document properties) without loading the workbook itself. You can use the retrieved metadata to search for a specific document, to organize files, or to collect statistics.

The Spreadsheet Document API can load document properties from workbooks in the following formats:

  • XLSX,

  • XLSM,

  • XLSB,

  • XLS,

  • XLTX,

  • XLTM,

  • XLT,

  • XML (XML Spreadsheet 2003).

For CSV and TXT files or encrypted documents, the LoadDocumentProperties method returns empty properties. If the loaded document is corrupted or its format is unknown, the LoadDocumentProperties method throws an exception.

See Also

How to: Load Document Properties for a Workbook

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace