NativeExcel for .Net Developer's Reference

IPageSetup.Zoom Property

Gets or sets a percentage (between 10 and 400 percent) by which the worksheet will be scaled for printing.

[Visual Basic]
Property Zoom As Integer
[C#]
int Zoom { get; set; }
[C++]
__property int get_Zoom();
__property void set_Zoom(int );
[JScript]
function get Zoom() : int
function set Zoom(int);

Property Value

If the FitToPages property is true, the Zoom property is ignored and the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. All scaling retains the aspect ratio of the original document.

Example

This example scales sheet one by 150 percent when the worksheet is printed.

[C#]
book.Worksheets[1].PageSetup.Zoom = 150;
[Visual Basic]
book.Worksheets(1).PageSetup.Zoom = 150
[C++]
book->Worksheets->Item[1]->PageSetup->Zoom = 150;

See Also

IPageSetup Interface | NativeExcel Namespace | PageSetup Property | FitToPagesWide Property | FitToPagesTall Property | FitToPages Property