Show / Hide Table of Contents

Class ExcelThreadedCommentThread

Represents a thread of ExcelThreadedComments in a cell on a worksheet. Contains functionality to add and modify these comments.

Inheritance
System.Object
ExcelThreadedCommentThread
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: OfficeOpenXml.ThreadedComments
Assembly: EPPlus.dll
Syntax
public class ExcelThreadedCommentThread

Constructors

ExcelThreadedCommentThread(ExcelCellAddress, XmlDocument, ExcelWorksheet)

Declaration
public ExcelThreadedCommentThread(ExcelCellAddress cellAddress, XmlDocument commentsXml, ExcelWorksheet worksheet)
Parameters
Type Name Description
ExcelCellAddress cellAddress
System.Xml.XmlDocument commentsXml
ExcelWorksheet worksheet

Properties

CellAddress

The address of the cell of the comment thread

Declaration
public ExcelCellAddress CellAddress { get; }
Property Value
Type Description
ExcelCellAddress

Comments

Declaration
public ExcelThreadedCommentCollection Comments { get; }
Property Value
Type Description
ExcelThreadedCommentCollection

IsResolved

If true the thread is resolved, i.e. closed for edits or further comments.

Declaration
public bool IsResolved { get; }
Property Value
Type Description
System.Boolean

ThreadedCommentsXml

The raw xml representing this comment thread.

Declaration
public XmlDocument ThreadedCommentsXml { get; }
Property Value
Type Description
System.Xml.XmlDocument

Worksheet

The worksheet where this comment thread resides

Declaration
public ExcelWorksheet Worksheet { get; }
Property Value
Type Description
ExcelWorksheet

Methods

AddComment(String, String)

Adds a ExcelThreadedComment to the thread

Declaration
public ExcelThreadedComment AddComment(string personId, string text)
Parameters
Type Name Description
System.String personId

Id of the author, see ExcelThreadedCommentPerson

System.String text

Text of the comment

Returns
Type Description
ExcelThreadedComment

AddComment(String, String, ExcelThreadedCommentPerson[])

Adds a ExcelThreadedComment with mentions in the text to the thread.

Declaration
public ExcelThreadedComment AddComment(string personId, string textWithFormats, params ExcelThreadedCommentPerson[] personsToMention)
Parameters
Type Name Description
System.String personId

Id of the ExcelThreadedCommentPerson

System.String textWithFormats

A string with format placeholders - same as in string.Format. Index in these should correspond to an index in the personsToMention array.

ExcelThreadedCommentPerson[] personsToMention

A params array of ExcelThreadedCommentPerson. Their DisplayName property will be used to replace the format placeholders.

Returns
Type Description
ExcelThreadedComment

The added ExcelThreadedComment

DeleteThread()

Deletes all ExcelThreadedComments in the thread and the legacy ExcelComment in the cell.

Declaration
public void DeleteThread()

Remove(ExcelThreadedComment)

Removes a ExcelThreadedComment from the thread.

Declaration
public bool Remove(ExcelThreadedComment comment)
Parameters
Type Name Description
ExcelThreadedComment comment

The comment to remove

Returns
Type Description
System.Boolean

true if the comment was removed, otherwise false

ReopenThread()

Re-opens a resolved thread.

Declaration
public void ReopenThread()

ResolveThread()

Closes the thread, only the author can re-open it.

Declaration
public void ResolveThread()

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()
In This Article
Back to top Generated by DocFX