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]
Property PrintArea As String
[C#]
string PrintArea { get; set; }
[C++]
__property String* get_PrintArea();
__property void set_PrintArea(String* );
[JScript]
function get PrintArea() : String
function set PrintArea(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";
[Visual Basic]
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