Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeExcelComment

Module
PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument System.String[]

Gets notes and threaded comments that match a filter.

Syntax

Get-OfficeExcelComment
[-Author <String>]
[-Document <ExcelDocument>]
[-Kind <All|Note|Threaded>]
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]
#
Parameter set: Document
Get-OfficeExcelComment
[-Author <String>]
[-Kind <All|Note|Threaded>]
[-Path] <String[]>
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]
#
Parameter set: Path
Get-OfficeExcelComment
[-Author <String>]
[-Kind <All|Note|Threaded>]
-LiteralPath <String[]>
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]
#
Parameter set: LiteralPath

Examples

List all comments

Get-OfficeExcelComment -Path .\Finance\Forecast-2027.xlsx

Shows every note and threaded comment in the workbook.

Collect open review threads

Get-OfficeExcelComment -Path .\Finance\Forecast-2027.xlsx -Kind Threaded -Author 'Anna Kowalska' |
                Export-OfficeExcel -Path .\Reviews\Forecast-Comments.xlsx -Title 'Open review comments'

Finds the threaded comments left by the finance reviewer and exports them as a review list.

Parameters

-Author String optional
Comment author to match, ignoring case.
-Document ExcelDocument optionalpipeline: True (ByValue)sets: Document
Caller-owned workbook; omission uses the enclosing Excel content block.
-Kind ExcelCommentKind optional
Metadata kind to add.
Possible values: All, Note, Threaded
-Range String optional
A1 cell range on the selected worksheet.
-Sheet OfficeSheetSelector[] optionalaliases: WorksheetName
Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
-TextContains String optional
Text fragment to match, ignoring case.
-Path String[] requiredposition: 0pipeline: True (ByValue)aliases: FilePathsets: Path
Workbook paths resolved with filesystem wildcard support.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
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.