API Reference
Cmdlet
Set-OfficeExcelPrintLayout
Applies a reusable worksheet print layout preset.
Remarks
Applies a reusable worksheet print layout preset.
Examples
Apply a report print layout.
PS>
ExcelSheet 'Report' { Set-OfficeExcelPrintLayout -Preset Report -PrintArea A1:H40 }
Applies landscape orientation, narrow margins, one-page-wide scaling, and repeated header row.
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-OfficeExcelPrintLayout [-FitToHeight <Nullable`1>] [-FitToWidth <Nullable`1>] [-Margins <Nullable`1>] [-NoPresetPrintTitles] [-Orientation <Nullable`1>] [-PageOrder <Nullable`1>] [-PassThru] [-Preset <Worksheet|Report|Dashboard|DataTable>] [-PrintArea <String>] [-RepeatFirstColumn <Nullable`1>] [-RepeatFirstRow <Nullable`1>] [-RepeatLastColumn <Nullable`1>] [-RepeatLastRow <Nullable`1>] [-Scale <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]#Parameter set:
ContextParameters
- FitToHeight Nullable`1
- Optional pages-tall fit override. Use 0 for unlimited height.
- FitToWidth Nullable`1
- Optional pages-wide fit override.
- Margins Nullable`1
- Optional margin preset override.
- NoPresetPrintTitles SwitchParameter
- Do not apply print-title rows from the selected preset.
- Orientation Nullable`1
- Optional orientation override.
- PageOrder Nullable`1
- Optional multi-page print order override.
- 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 Nullable`1
- Optional first 1-based repeated print-title column.
- RepeatFirstRow Nullable`1
- Optional first 1-based repeated print-title row.
- RepeatLastColumn Nullable`1
- Optional last 1-based repeated print-title column.
- RepeatLastRow Nullable`1
- Optional last 1-based repeated print-title row.
- Scale Nullable`1
- Optional manual scale percentage override.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
Outputs
OfficeIMO.Excel.ExcelSheet System.Management.Automation.PSObject
Set-OfficeExcelPrintLayout [-FitToHeight <Nullable`1>] [-FitToWidth <Nullable`1>] -InputPath <String> [-Margins <Nullable`1>] [-NoPresetPrintTitles] [-Orientation <Nullable`1>] [-PageOrder <Nullable`1>] [-PassThru] [-Preset <Worksheet|Report|Dashboard|DataTable>] [-PrintArea <String>] [-RepeatFirstColumn <Nullable`1>] [-RepeatFirstRow <Nullable`1>] [-RepeatLastColumn <Nullable`1>] [-RepeatLastRow <Nullable`1>] [-Scale <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]#Parameter set:
PathParameters
- FitToHeight Nullable`1
- Optional pages-tall fit override. Use 0 for unlimited height.
- FitToWidth Nullable`1
- Optional pages-wide fit override.
- InputPath String
- Workbook path to update.
- Margins Nullable`1
- Optional margin preset override.
- NoPresetPrintTitles SwitchParameter
- Do not apply print-title rows from the selected preset.
- Orientation Nullable`1
- Optional orientation override.
- PageOrder Nullable`1
- Optional multi-page print order override.
- 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 Nullable`1
- Optional first 1-based repeated print-title column.
- RepeatFirstRow Nullable`1
- Optional first 1-based repeated print-title row.
- RepeatLastColumn Nullable`1
- Optional last 1-based repeated print-title column.
- RepeatLastRow Nullable`1
- Optional last 1-based repeated print-title row.
- Scale Nullable`1
- Optional manual scale percentage override.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
Outputs
OfficeIMO.Excel.ExcelSheet System.Management.Automation.PSObject
Set-OfficeExcelPrintLayout -Document <ExcelDocument> [-FitToHeight <Nullable`1>] [-FitToWidth <Nullable`1>] [-Margins <Nullable`1>] [-NoPresetPrintTitles] [-Orientation <Nullable`1>] [-PageOrder <Nullable`1>] [-PassThru] [-Preset <Worksheet|Report|Dashboard|DataTable>] [-PrintArea <String>] [-RepeatFirstColumn <Nullable`1>] [-RepeatFirstRow <Nullable`1>] [-RepeatLastColumn <Nullable`1>] [-RepeatLastRow <Nullable`1>] [-Scale <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document ExcelDocument
- Workbook to update outside the DSL context.
- FitToHeight Nullable`1
- Optional pages-tall fit override. Use 0 for unlimited height.
- FitToWidth Nullable`1
- Optional pages-wide fit override.
- Margins Nullable`1
- Optional margin preset override.
- NoPresetPrintTitles SwitchParameter
- Do not apply print-title rows from the selected preset.
- Orientation Nullable`1
- Optional orientation override.
- PageOrder Nullable`1
- Optional multi-page print order override.
- 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 Nullable`1
- Optional first 1-based repeated print-title column.
- RepeatFirstRow Nullable`1
- Optional first 1-based repeated print-title row.
- RepeatLastColumn Nullable`1
- Optional last 1-based repeated print-title column.
- RepeatLastRow Nullable`1
- Optional last 1-based repeated print-title row.
- Scale Nullable`1
- Optional manual scale percentage override.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
Outputs
OfficeIMO.Excel.ExcelSheet System.Management.Automation.PSObject