Cmdlet
Set-OfficeExcelPrintLayout
Applies a reusable worksheet print layout preset.
Syntax
Set-OfficeExcelPrintLayout
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal| Narrow| Moderate| Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait| Landscape>]
[-PageOrder <DownThenOver| OverThenDown>]
[-PassThru]
[-Preset <Worksheet| Report| Dashboard| DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]#Parameter set:
ContextSet-OfficeExcelPrintLayout
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal| Narrow| Moderate| Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait| Landscape>]
[-PageOrder <DownThenOver| OverThenDown>]
[-PassThru]
[-Path] <String>
[-Preset <Worksheet| Report| Dashboard| DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]#Parameter set:
PathSet-OfficeExcelPrintLayout
-Document <ExcelDocument>
[-FitToHeight <UInt32>]
[-FitToWidth <UInt32>]
[-Margins <Normal| Narrow| Moderate| Wide>]
[-NoPresetPrintTitles]
[-Orientation <Portrait| Landscape>]
[-PageOrder <DownThenOver| OverThenDown>]
[-PassThru]
[-Preset <Worksheet| Report| Dashboard| DataTable>]
[-PrintArea <String>]
[-RepeatFirstColumn <Int32>]
[-RepeatFirstRow <Int32>]
[-RepeatLastColumn <Int32>]
[-RepeatLastRow <Int32>]
[-Scale <UInt32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[<CommonParameters>]#Parameter set:
DocumentExamples
Apply a report print layout.
ExcelSheet 'Report' { Set-OfficeExcelPrintLayout -Preset Report -PrintArea A1:H40 }Applies landscape orientation, narrow margins, one-page-wide scaling, and repeated header row.
Parameters
- -FitToHeight UInt32
- Optional pages-tall fit override. Use 0 for unlimited height.
- -FitToWidth UInt32
- Optional pages-wide fit override.
- -Margins ExcelMarginPreset
- Optional margin preset override.
- Possible values:
Normal,Narrow,Moderate,Wide - -NoPresetPrintTitles SwitchParameter
- Do not apply print-title rows from the selected preset.
- -Orientation OfficePageOrientation
- Optional orientation override.
- Possible values:
Portrait,Landscape - -PageOrder ExcelPageOrder
- Optional multi-page print order override.
- Possible values:
DownThenOver,OverThenDown - -PassThru SwitchParameter
- Emit the worksheet after applying the layout.
- -Preset ExcelPrintLayoutPreset
- Print layout preset.
- Possible values:
Worksheet,Report,Dashboard,DataTable - -PrintArea String
- Optional print area in A1 notation.
- -RepeatFirstColumn Int32
- Optional first 1-based repeated print-title column.
- -RepeatFirstRow Int32
- Optional first 1-based repeated print-title row.
- -RepeatLastColumn Int32
- Optional last 1-based repeated print-title column.
- -RepeatLastRow Int32
- Optional last 1-based repeated print-title row.
- -Scale UInt32
- Optional manual scale percentage override.
- -Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- -SheetIndex Int32
- Worksheet index when using a workbook object or path.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- Workbook to update outside the DSL context.
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.