API Reference

Cmdlet

Add-OfficeExcelThreadedComment

Aliases: ExcelThreadedComment
Namespace PSWriteOffice
Aliases
ExcelThreadedComment
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Adds a threaded comment or reply to an Excel worksheet.

Remarks

Adds a threaded comment or reply to an Excel worksheet.

Examples

Authored help example

Add a threaded review note and audit it before sharing.

PS>


$comment = Add-OfficeExcelThreadedComment -Path .\Review.xlsx -Sheet Data -Address C5 -Text 'Please confirm this variance.' -Author 'Finance Reviewer' -PassThru
            Add-OfficeExcelThreadedComment -Path .\Review.xlsx -Sheet Data -Address C5 -Text 'Confirmed with sales ops.' -Author 'Report Owner' -ParentId $comment.Id
            Get-OfficeExcelCommentAudit -Path .\Review.xlsx -IncludeComments |
                Select-Object -ExpandProperty ThreadedComments
        

Uses OfficeIMO threaded-comment metadata authoring, including workbook person metadata, and keeps legacy notes separate.

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-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <Nullable`1>] [-Done] [-Id <String>] [-ParentId <String>] [-PassThru] -Text <String> [<CommonParameters>]
#
Parameter set: Context

Parameters

Address String requiredposition: namedpipeline: False
A1-style cell address, such as C5.
Author String optionalposition: namedpipeline: False
Author display name stored in workbook person metadata.
Date Nullable`1 optionalposition: namedpipeline: False
Optional timestamp for the threaded comment.
Done SwitchParameter optionalposition: namedpipeline: False
Mark the threaded comment as done/resolved.
Id String optionalposition: namedpipeline: False
Optional stable threaded-comment id.
ParentId String optionalposition: namedpipeline: False
Optional parent threaded-comment id when adding a reply.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit threaded-comment metadata.
Text String requiredposition: namedpipeline: False
Threaded comment text.

Outputs

System.Management.Automation.PSObject

Add-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <Nullable`1>] [-Done] [-Id <String>] -InputPath <String> [-NoSave] [-ParentId <String>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Text <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

Address String requiredposition: namedpipeline: False
A1-style cell address, such as C5.
Author String optionalposition: namedpipeline: False
Author display name stored in workbook person metadata.
Date Nullable`1 optionalposition: namedpipeline: False
Optional timestamp for the threaded comment.
Done SwitchParameter optionalposition: namedpipeline: False
Mark the threaded comment as done/resolved.
Id String optionalposition: namedpipeline: False
Optional stable threaded-comment id.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
NoSave SwitchParameter optionalposition: namedpipeline: False
Do not save when operating on a path-owned workbook.
ParentId String optionalposition: namedpipeline: False
Optional parent threaded-comment id when adding a reply.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit threaded-comment metadata.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using path or document input.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using path or document input.
Text String requiredposition: namedpipeline: False
Threaded comment text.

Outputs

System.Management.Automation.PSObject

Add-OfficeExcelThreadedComment -Address <String> [-Author <String>] [-Date <Nullable`1>] -Document <ExcelDocument> [-Done] [-Id <String>] [-ParentId <String>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Text <String> [<CommonParameters>]
#
Parameter set: Document

Parameters

Address String requiredposition: namedpipeline: False
A1-style cell address, such as C5.
Author String optionalposition: namedpipeline: False
Author display name stored in workbook person metadata.
Date Nullable`1 optionalposition: namedpipeline: False
Optional timestamp for the threaded comment.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
Done SwitchParameter optionalposition: namedpipeline: False
Mark the threaded comment as done/resolved.
Id String optionalposition: namedpipeline: False
Optional stable threaded-comment id.
ParentId String optionalposition: namedpipeline: False
Optional parent threaded-comment id when adding a reply.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit threaded-comment metadata.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using path or document input.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using path or document input.
Text String requiredposition: namedpipeline: False
Threaded comment text.

Outputs

System.Management.Automation.PSObject