Back to Devexpress

Worksheet.CreateThreadedCommentAuthor(String, String, String) Method

officefileapi-devexpress-dot-spreadsheet-dot-worksheet-dot-createthreadedcommentauthor-x28-system-dot-string-system-dot-string-system-dot-string-x29.md

latest3.4 KB
Original Source

Worksheet.CreateThreadedCommentAuthor(String, String, String) Method

Creates a new object that contains information about the comment author.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
ThreadedCommentAuthor CreateThreadedCommentAuthor(
    string name,
    string userId,
    string providerId
)
vb
Function CreateThreadedCommentAuthor(
    name As String,
    userId As String,
    providerId As String
) As ThreadedCommentAuthor

Parameters

NameTypeDescription
nameString

The name of the author.

| | userId | String |

The author’s user identifier.

| | providerId | String |

The author’s provider identifier.

|

Returns

TypeDescription
ThreadedCommentAuthor

An object that contains the author information.

|

Remarks

Use this method if you need to specify additional information about the author. Pass the created object as the ThreadedCommentCollection.Add or ThreadedComment.Reply method parameter to create a comment or reply from the specified author.

Example

The code sample below creates a new object, specifies the provider and user identifiers, and uses this object to create a comment:

csharp
var workbook = new Workbook();
workbook.LoadDocument(@"C:\Docs\Comments.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
var comments = worksheet.ThreadedComments;

var author =
  worksheet.CreateThreadedCommentAuthor("Ryan Anita W", "S::[email protected]::ccdb79f7-8acb-46ab-a6d9-4f4340797155", "AD");

comments.Add(worksheet["D5"], author, "Thank you");
workbook.SaveDocument(@"C:\Docs\Comments_upd.xlsx");
vb
Option Infer On

Dim workbook As New Workbook()
workbook.LoadDocument("C:\Docs\Comments.xlsx")
Dim worksheet As Worksheet = workbook.Worksheets(0)
Dim comments = worksheet.ThreadedComments

Dim author = worksheet.CreateThreadedCommentAuthor("Ryan Anita W", "S::[email protected]::ccdb79f7-8acb-46ab-a6d9-4f4340797155", "AD")

comments.Add(worksheet("D5"), author, "Thank you")
workbook.SaveDocument("C:\Docs\Comments_upd.xlsx")

See Also

Worksheet Interface

Worksheet Members

DevExpress.Spreadsheet Namespace