OfficeIMO

API Reference

Command

Add-OfficeExcelImage

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

Adds an image anchored to a worksheet cell.

Remarks

Adds an image anchored to a worksheet cell.

Examples

Insert an image from disk at B2.


PS>ExcelSheet 'Data' { Add-OfficeExcelImage -Address 'B2' -Path .\logo.png -WidthPixels 120 -HeightPixels 40 }
        

Anchors the image to cell B2.

Insert an image from a URL.


PS>ExcelSheet 'Data' { Add-OfficeExcelImage -Row 1 -Column 1 -Url 'https://example.org/logo.png' }
        

Downloads and anchors the image to cell A1.

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

Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] -Path <String> [-Row <Nullable`1>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: ContextPath

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
HeightPixels Int32 optionalposition: namedpipeline: False
Image height in pixels.
OffsetXPixels Int32 optionalposition: namedpipeline: False
Horizontal offset in pixels from the cell origin.
OffsetYPixels Int32 optionalposition: namedpipeline: False
Vertical offset in pixels from the cell origin.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after inserting the image.
Path String requiredposition: 0pipeline: False
Image file path.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
WidthPixels Int32 optionalposition: namedpipeline: False
Image width in pixels.

Outputs

System.Object

Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] -Document <ExcelDocument> [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] -Path <String> [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: DocumentPath

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
HeightPixels Int32 optionalposition: namedpipeline: False
Image height in pixels.
OffsetXPixels Int32 optionalposition: namedpipeline: False
Horizontal offset in pixels from the cell origin.
OffsetYPixels Int32 optionalposition: namedpipeline: False
Vertical offset in pixels from the cell origin.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after inserting the image.
Path String requiredposition: 0pipeline: False
Image file path.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
WidthPixels Int32 optionalposition: namedpipeline: False
Image width in pixels.

Outputs

System.Object

Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] -Document <ExcelDocument> [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Url <String> [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: DocumentUrl

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
HeightPixels Int32 optionalposition: namedpipeline: False
Image height in pixels.
OffsetXPixels Int32 optionalposition: namedpipeline: False
Horizontal offset in pixels from the cell origin.
OffsetYPixels Int32 optionalposition: namedpipeline: False
Vertical offset in pixels from the cell origin.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after inserting the image.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
Url String requiredposition: 0pipeline: False
Image URL to download.
WidthPixels Int32 optionalposition: namedpipeline: False
Image width in pixels.

Outputs

System.Object

Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] [-Row <Nullable`1>] -Url <String> [-WidthPixels <Int32>] [<CommonParameters>]
#
Parameter set: ContextUrl

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
HeightPixels Int32 optionalposition: namedpipeline: False
Image height in pixels.
OffsetXPixels Int32 optionalposition: namedpipeline: False
Horizontal offset in pixels from the cell origin.
OffsetYPixels Int32 optionalposition: namedpipeline: False
Vertical offset in pixels from the cell origin.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the worksheet after inserting the image.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Url String requiredposition: 0pipeline: False
Image URL to download.
WidthPixels Int32 optionalposition: namedpipeline: False
Image width in pixels.

Outputs

System.Object