NativeExcel for .Net Developer's Reference

IPageSetup.FitToPages Property

Gets or sets a value that indicates whether the worksheet is scaled for printing using Zoom property or FitToPagesWide and FitToPagesTall properties.

[Visual Basic]
PropertyFitToPagesAsBoolean
[C#]
boolFitToPages{get;set;}
[C++]
__propertyboolget_FitToPages();
__propertyvoidset_FitToPages(bool);
[JScript]
functiongetFitToPages():bool
functionsetFitToPages(bool);

Property Value

True if worksheet is scaled using FitToPagesWide and FitToPagesTall properties; False if worksheet is scaled using Zoom property.

Example

This example causes to print worksheet one exactly one page tall and wide.

[C#]
book.Worksheets[1].PageSetup.FitToPagesTall = 1;
book.Worksheets[1].PageSetup.FitToPagesWide = 1;
book.Worksheets[1].PageSetup.Zoom = 50;
book.Worksheets[1].PageSetup.FitToPages = true;
[VisualBasic]
book.Worksheets(1).PageSetup.FitToPagesTall = 1
book.Worksheets(1).PageSetup.FitToPagesWide = 1
book.Worksheets(1).PageSetup.Zoom = 50
book.Worksheets(1).PageSetup.FitToPages = True
[C++]
book->Worksheets->Item[1]->PageSetup->FitToPagesTall = 1;
book->Worksheets->Item[1]->PageSetup->FitToPagesWide = 1;
book->Worksheets->Item[1]->PageSetup->Zoom = 50;
book->Worksheets->Item[1]->PageSetup->FitToPages = true;

See Also

IPageSetup Interface | NativeExcel Namespace | FitToPagesWide Property | FitToPagesTall Property | Zoom Property