API Reference

Cmdlet

Set-OfficeExcelRichText

Aliases: ExcelRichText
Namespace PSWriteOffice
Aliases
ExcelRichText
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Sets mixed-format rich text runs in an Excel cell.

Remarks

Sets mixed-format rich text runs in an Excel cell.

Examples

Authored help example

Write a status label with a bold colored value.

PS>


ExcelSheet 'Summary' {
                Set-OfficeExcelRichText -Address A1 -Run 'Status: ', @{ Text = 'Blocked'; Bold = $true; Color = '#C00000' }
            }
        

Stores inline rich text in the target cell using OfficeIMO's reusable rich-text cell model.

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-OfficeExcelRichText [-Address <String>] [-Column <Nullable`1>] [-PassThru] [-Row <Nullable`1>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address.
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit written rich text runs.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Run Object[] requiredposition: namedpipeline: Falsealiases: Runs
Rich text runs. Each run can be a string, hashtable, PSCustomObject, or ExcelRichTextRun.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object

Set-OfficeExcelRichText [-Address <String>] [-Column <Nullable`1>] -InputPath <String> [-PassThru] [-Row <Nullable`1>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Path

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address.
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit written rich text runs.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Run Object[] requiredposition: namedpipeline: Falsealiases: Runs
Rich text runs. Each run can be a string, hashtable, PSCustomObject, or ExcelRichTextRun.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object

Set-OfficeExcelRichText [-Address <String>] [-Column <Nullable`1>] -Document <ExcelDocument> [-PassThru] [-Row <Nullable`1>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address.
Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit written rich text runs.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Run Object[] requiredposition: namedpipeline: Falsealiases: Runs
Rich text runs. Each run can be a string, hashtable, PSCustomObject, or ExcelRichTextRun.
Sheet String optionalposition: namedpipeline: Falsealiases: WorksheetName
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.

Outputs

System.Object