NativeExcel for .Net Developer's Reference

IPageSetup.PrintArea Property

Gets or sets the range to be printed, as a string using A1-style references.

[Visual Basic]
PropertyPrintAreaAsString
[C#]
stringPrintArea{get;set;}
[C++]
__propertyString*get_PrintArea();
__propertyvoidset_PrintArea(String*);
[JScript]
functiongetPrintArea():String
functionsetPrintArea(String);

Remarks

Set this property to the empty string to set the print area to the entire sheet.

Example

This example sets the print area to cells A1:C5 on worksheet one.

[C#]
book.Worksheets[1].PageSetup.PrintArea = "A1:C5";
[VisualBasic]
book.Worksheets(1).PageSetup.PrintArea = "A1:C5"
[C++]
book->Worksheets->Item[1]->PageSetup->PrintArea = S"A1:C5";

See Also

IPageSetup Interface | NativeExcel Namespace | PageSetup Property | SetPrintArea Method | PrintAreaDefined Property