Comment Constructor (DocumentBase, String, String, DateTime)

Initializes a new instance of the Comment class.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public Comment(
	DocumentBase doc,
	string author,
	string initial,
	DateTime dateTime
)

Parameters

doc
Type: Aspose.WordsDocumentBase
The owner document.
author
Type: SystemString
The author name for the comment. Cannot be null.
initial
Type: SystemString
The author initials for the comment. Cannot be null.
dateTime
Type: SystemDateTime
The date and time for the comment.
Examples
Shows how to add a comment to a paragraph in the document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Some text is added.");

Comment comment = new Comment(doc, "Amy Lee", "AL", DateTime.Today);
builder.CurrentParagraph.AppendChild(comment);
comment.Paragraphs.Add(new Paragraph(doc));
comment.FirstParagraph.Runs.Add(new Run(doc, "Comment text."));
See Also