OfficeIMO

API Reference

Command

Set-OfficeExcelHeaderFooter

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

Sets worksheet header and footer text and optional images.

Remarks

Sets worksheet header and footer text and optional images.

Examples

Set a centered header with a page footer.


PS>ExcelSheet 'Data' { Set-OfficeExcelHeaderFooter -HeaderCenter 'Demo' -FooterRight 'Page &P of &N' }
        

Applies header and footer text to the worksheet.

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-OfficeExcelHeaderFooter [-AlignWithMargins <Boolean>] [-DifferentFirstPage] [-DifferentOddEven] [-FooterCenter <String>] [-FooterImagePath <String>] [-FooterImagePosition <Left|Center|Right>] [-FooterImageUrl <String>] [-FooterLeft <String>] [-FooterRight <String>] [-HeaderCenter <String>] [-HeaderImagePath <String>] [-HeaderImagePosition <Left|Center|Right>] [-HeaderImageUrl <String>] [-HeaderLeft <String>] [-HeaderRight <String>] [-ImageHeightPoints <Nullable`1>] [-ImageWidthPoints <Nullable`1>] [-PassThru] [-ScaleWithDocument <Boolean>] [<CommonParameters>]
#
Parameter set: Context

Parameters

AlignWithMargins Boolean optionalposition: namedpipeline: False
Align header/footer with margins (default: true).
DifferentFirstPage SwitchParameter optionalposition: namedpipeline: False
Use a different header/footer on the first page.
DifferentOddEven SwitchParameter optionalposition: namedpipeline: False
Use different headers/footers on odd/even pages.
FooterCenter String optionalposition: namedpipeline: False
Center footer text.
FooterImagePath String optionalposition: namedpipeline: False
Footer image file path.
FooterImagePosition HeaderFooterPosition optionalposition: namedpipeline: Falsevalues: 3
Footer image position.
Possible values: Left, Center, Right
FooterImageUrl String optionalposition: namedpipeline: False
Footer image URL.
FooterLeft String optionalposition: namedpipeline: False
Left footer text.
FooterRight String optionalposition: namedpipeline: False
Right footer text.
HeaderCenter String optionalposition: namedpipeline: False
Center header text.
HeaderImagePath String optionalposition: namedpipeline: False
Header image file path.
HeaderImagePosition HeaderFooterPosition optionalposition: namedpipeline: Falsevalues: 3
Header image position.
Possible values: Left, Center, Right
HeaderImageUrl String optionalposition: namedpipeline: False
Header image URL.
HeaderLeft String optionalposition: namedpipeline: False
Left header text.
HeaderRight String optionalposition: namedpipeline: False
Right header text.
ImageHeightPoints Nullable`1 optionalposition: namedpipeline: False
Image height in points.
ImageWidthPoints Nullable`1 optionalposition: namedpipeline: False
Image width in points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after updating.
ScaleWithDocument Boolean optionalposition: namedpipeline: False
Scale header/footer with document (default: true).

Outputs

System.Object

Set-OfficeExcelHeaderFooter [-AlignWithMargins <Boolean>] [-DifferentFirstPage] [-DifferentOddEven] -Document <ExcelDocument> [-FooterCenter <String>] [-FooterImagePath <String>] [-FooterImagePosition <Left|Center|Right>] [-FooterImageUrl <String>] [-FooterLeft <String>] [-FooterRight <String>] [-HeaderCenter <String>] [-HeaderImagePath <String>] [-HeaderImagePosition <Left|Center|Right>] [-HeaderImageUrl <String>] [-HeaderLeft <String>] [-HeaderRight <String>] [-ImageHeightPoints <Nullable`1>] [-ImageWidthPoints <Nullable`1>] [-PassThru] [-ScaleWithDocument <Boolean>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

AlignWithMargins Boolean optionalposition: namedpipeline: False
Align header/footer with margins (default: true).
DifferentFirstPage SwitchParameter optionalposition: namedpipeline: False
Use a different header/footer on the first page.
DifferentOddEven SwitchParameter optionalposition: namedpipeline: False
Use different headers/footers on odd/even pages.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
FooterCenter String optionalposition: namedpipeline: False
Center footer text.
FooterImagePath String optionalposition: namedpipeline: False
Footer image file path.
FooterImagePosition HeaderFooterPosition optionalposition: namedpipeline: Falsevalues: 3
Footer image position.
Possible values: Left, Center, Right
FooterImageUrl String optionalposition: namedpipeline: False
Footer image URL.
FooterLeft String optionalposition: namedpipeline: False
Left footer text.
FooterRight String optionalposition: namedpipeline: False
Right footer text.
HeaderCenter String optionalposition: namedpipeline: False
Center header text.
HeaderImagePath String optionalposition: namedpipeline: False
Header image file path.
HeaderImagePosition HeaderFooterPosition optionalposition: namedpipeline: Falsevalues: 3
Header image position.
Possible values: Left, Center, Right
HeaderImageUrl String optionalposition: namedpipeline: False
Header image URL.
HeaderLeft String optionalposition: namedpipeline: False
Left header text.
HeaderRight String optionalposition: namedpipeline: False
Right header text.
ImageHeightPoints Nullable`1 optionalposition: namedpipeline: False
Image height in points.
ImageWidthPoints Nullable`1 optionalposition: namedpipeline: False
Image width in points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after updating.
ScaleWithDocument Boolean optionalposition: namedpipeline: False
Scale header/footer with document (default: true).
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