CommentSetText Method

This is a convenience method that allows to easily set text of the comment.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.5
public void SetText(
	string text


Type: SystemString
The new text of the comment.

This method allows to quickly set text of a comment from a string. The string can contain paragraph breaks, this will create paragraphs of text in the comment accordingly. If you want to insert more complex elements into the comment, for example bookmarks or tables or apply rich formatting, then you need to use the appropriate node classes to build up the comment text.

Shows how to add a comment with a reply to a document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Create new comment
Comment newComment = new Comment(doc, "John Doe", "J.D.", DateTime.Now);
newComment.SetText("My comment.");

// Add this comment to a document node

// Add comment reply
newComment.AddReply("John Doe", "JD", new DateTime(2017, 9, 25, 12, 15, 0), "New reply");
See Also