OfficeIMO

API Reference

Command

Set-OfficeExcelPageSetup

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Configures page setup options on a worksheet.

Remarks

Configures page setup options on a worksheet.

Examples

Fit to one page wide.


PS>ExcelSheet 'Data' { Set-OfficeExcelPageSetup -FitToWidth 1 -FitToHeight 0 }
        

Fits the sheet to one page wide and unlimited height.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Set-OfficeExcelPageSetup [-FitToHeight <Nullable`1>] [-FitToWidth <Nullable`1>] [-PassThru] [-Scale <Nullable`1>] [<CommonParameters>]
#
Parameter set: Context

Parameters

FitToHeight Nullable`1 optionalposition: namedpipeline: False
Number of pages to fit vertically.
FitToWidth Nullable`1 optionalposition: namedpipeline: False
Number of pages to fit horizontally.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after applying settings.
Scale Nullable`1 optionalposition: namedpipeline: False
Manual scale percentage (10-400).

Outputs

System.Object

Set-OfficeExcelPageSetup -Document <ExcelDocument> [-FitToHeight <Nullable`1>] [-FitToWidth <Nullable`1>] [-PassThru] [-Scale <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
FitToHeight Nullable`1 optionalposition: namedpipeline: False
Number of pages to fit vertically.
FitToWidth Nullable`1 optionalposition: namedpipeline: False
Number of pages to fit horizontally.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after applying settings.
Scale Nullable`1 optionalposition: namedpipeline: False
Manual scale percentage (10-400).
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.

Outputs

System.Object