NativeExcel for .Net Developer's Reference

IPageSetup.PaperSize Property

Gets or sets the size of the paper.

[Visual Basic]
PropertyPaperSizeAsXlPaperSize
[C#]
XlPaperSizePaperSize{get;set;}
[C++]
__propertyXlPaperSizeget_PaperSize();
__propertyvoidset_PaperSize(XlPaperSize);
[JScript]
functiongetPaperSize():XlPaperSize
functionsetPaperSize(XlPaperSize);

Property Value

PaperSize can be one of XlPaperSize values.

Example

This example sets the paper size to legal for worksheet one.

[C#]
book.Worksheets[1].PageSetup.PaperSize = XlPaperSize.xlPaperLegal;
[VisualBasic]
book.Worksheets(1).PageSetup.PaperSize = XlPaperSize.xlPaperLegal
[C++]
book->Worksheets->Item[1]->PageSetup->PaperSize = XlPaperSize::xlPaperLegal;

See Also

IPageSetup Interface | NativeExcel Namespace | XlPaperSize Enumeration | PageSetup Property