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
Syntaxpublic Comment(
DocumentBase doc,
string author,
string initial,
DateTime dateTime
)
Public Sub New (
doc As DocumentBase,
author As String,
initial As String,
dateTime As DateTime
)
public:
Comment(
DocumentBase^ doc,
String^ author,
String^ initial,
DateTime dateTime
)
new :
doc : DocumentBase *
author : string *
initial : string *
dateTime : DateTime -> Comment
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.
ExamplesShows 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