Back to Devexpress

Workbook.Unit Property

officefileapi-devexpress-dot-spreadsheet-dot-workbook-930a28dd.md

latest4.3 KB
Original Source

Workbook.Unit Property

Gets or sets a unit of measure used in the workbook.

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

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public DocumentUnit Unit { get; set; }
vb
Public Property Unit As DocumentUnit

Property Value

TypeDescription
DocumentUnit

The DocumentUnit enumeration member.

|

Available values:

NameDescription
Document

Specifies documents (one three-hundredths of an inch) as measurement units.

| | Inch |

Specifies inches as measurement units.

| | Millimeter |

Specifies millimeters as measurement units.

| | Centimeter |

Specifies centimeters as measurement units.

| | Point |

Specifies points as measurement units.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Unit property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-examples-part2/CS/SpreadsheetDocServerAPIPart2/CodeExamples/PictureActions.cs#L18

csharp
// Set the measurement unit to Millimeter.
workbook.Unit = DevExpress.Office.DocumentUnit.Millimeter;
try

spreadsheet-document-api-examples-part1/CS/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.cs#L149

csharp
// Specifies inches as the workbook's measurement units.
workbook.Unit = DevExpress.Office.DocumentUnit.Inch;

spreadsheet-document-api-examples-part2/VB/SpreadsheetDocServerAPIPart2/CodeExamples/PictureActions.vb#L15

vb
' Set the measurement unit to Millimeter.
workbook.Unit = DevExpress.Office.DocumentUnit.Millimeter
Try

spreadsheet-document-api-examples-part1/VB/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.vb#L143

vb
' Specifies inches as the workbook's measurement units.
workbook.Unit = DevExpress.Office.DocumentUnit.Inch
' Access page margins.

Implements

Unit

See Also

UnitChanging

UnitChanged

Measure Units in Spreadsheet Documents

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace