Cmdlet
Set-OfficeExcelRichText
Sets mixed-format rich text runs in an Excel cell.
Syntax
Set-OfficeExcelRichText [-Address <String>] [-Column <Int32>] [-PassThru] [-Row <Int32>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Int32>] [<CommonParameters>]#Parameter set:
ContextSet-OfficeExcelRichText [-Address <String>] [-Column <Int32>] [-PassThru] [-Path] <String> [-Row <Int32>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Int32>] [<CommonParameters>]#Parameter set:
PathSet-OfficeExcelRichText [-Address <String>] [-Column <Int32>] -Document <ExcelDocument> [-PassThru] [-Row <Int32>] -Run <Object[]> [-Sheet <String>] [-SheetIndex <Int32>] [<CommonParameters>]#Parameter set:
DocumentExamples
Write a status label with a bold colored value.
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.
Parameters
- -Address String
- A1-style cell address.
- -Column Int32
- 1-based column index.
- -PassThru SwitchParameter
- Emit written rich text runs.
- -Row Int32
- 1-based row index.
- -Run Object[]
- Rich text runs. Each run can be a string, hashtable, PSCustomObject, or ExcelRichTextRun.
- -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.