Cmdlet
Get-OfficeExcelRichText
Gets the rich-text runs of a cell.
Syntax
Get-OfficeExcelRichText
-Address <String>
[-Document <ExcelDocument>]
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
DocumentGet-OfficeExcelRichText
-Address <String>
[-Path] <String[]>
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
PathGet-OfficeExcelRichText
-Address <String>
-LiteralPath <String[]>
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
LiteralPathExamples
Read the text runs of a cell
Get-OfficeExcelRichText -Path .\Reports\Migration.xlsx -Sheet Overview -Address B3Returns each formatted run of B3 on the Overview sheet.
Find the bold parts of a status cell
$book = Open-OfficeExcel -Path .\Reports\Status.xlsx -ReadOnly
Get-OfficeExcelRichText -Document $book -Sheet Summary -Address B2 | Where-Object Bold
Close-OfficeExcel -Document $bookReads the runs of a status cell from an open workbook and keeps only the bold text.
Parameters
- -Address String
- A1 address of the target cell.
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -Sheet OfficeSheetSelector
- Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
- -Path String[]
- Workbook paths resolved with filesystem wildcard support.
- -LiteralPath String[]
- Literal workbook paths, including FileInfo.FullName and provider PSPath.
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.