Comment Class |
Namespace: Aspose.Words
The Comment type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Comment(DocumentBase) |
Initializes a new instance of the Comment class.
|
![]() ![]() | Comment(DocumentBase, String, String, DateTime) |
Initializes a new instance of the Comment class.
|
Name | Description | |
---|---|---|
![]() ![]() | Ancestor |
Returns the parent Comment object. Returns null for top-level comments.
|
![]() ![]() | Author |
Returns or sets the author name for a comment.
|
![]() ![]() | ChildNodes |
Gets all immediate child nodes of this node.
(Inherited from CompositeNode.) |
![]() ![]() | Count |
Gets the number of immediate children of this node.
(Inherited from CompositeNode.) |
![]() ![]() | DateTime |
Gets the date and time that the comment was made.
|
![]() ![]() | Document |
Gets the document to which this node belongs.
(Inherited from Node.) |
![]() ![]() | Done |
Gets or sets flag indicating that the comment has been marked done.
|
![]() ![]() | FirstChild |
Gets the first child of the node.
(Inherited from CompositeNode.) |
![]() ![]() | FirstParagraph |
Gets the first paragraph in the story.
(Inherited from InlineStory.) |
![]() ![]() | Font |
Provides access to the font formatting of the anchor character of this object.
(Inherited from InlineStory.) |
![]() ![]() | HasChildNodes |
Returns true if this node has any child nodes.
(Inherited from CompositeNode.) |
![]() ![]() | Id |
Gets the comment identifier.
|
![]() ![]() | Initial |
Returns or sets the initials of the user associated with a specific comment.
|
![]() ![]() | IsComposite |
Returns true as this node can have child nodes.
(Inherited from CompositeNode.) |
![]() ![]() | IsDeleteRevision |
Returns true if this object was deleted in Microsoft Word while change tracking was enabled.
(Inherited from InlineStory.) |
![]() ![]() | IsInsertRevision |
Returns true if this object was inserted in Microsoft Word while change tracking was enabled.
(Inherited from InlineStory.) |
![]() ![]() | IsMoveFromRevision |
Returns true if this object was moved (deleted) in Microsoft Word while change tracking was enabled.
(Inherited from InlineStory.) |
![]() ![]() | IsMoveToRevision |
Returns true if this object was moved (inserted) in Microsoft Word while change tracking was enabled.
(Inherited from InlineStory.) |
![]() ![]() | LastChild |
Gets the last child of the node.
(Inherited from CompositeNode.) |
![]() ![]() | LastParagraph |
Gets the last paragraph in the story.
(Inherited from InlineStory.) |
![]() ![]() | NextSibling |
Gets the node immediately following this node.
(Inherited from Node.) |
![]() ![]() | NodeType |
Returns NodeType.Comment.
(Overrides NodeNodeType.) |
![]() ![]() | Paragraphs |
Gets a collection of paragraphs that are immediate children of the story.
(Inherited from InlineStory.) |
![]() ![]() | ParentNode |
Gets the immediate parent of this node.
(Inherited from Node.) |
![]() ![]() | ParentParagraph |
Retrieves the parent Paragraph of this node.
(Inherited from InlineStory.) |
![]() ![]() | PreviousSibling |
Gets the node immediately preceding this node.
(Inherited from Node.) |
![]() ![]() | Range |
Returns a Range object that represents the portion of a document that is contained in this node.
(Inherited from Node.) |
![]() ![]() | Replies |
Returns a collection of Comment objects that are immediate children of the specified comment.
|
![]() ![]() | StoryType |
Returns StoryType.Comments.
(Overrides InlineStoryStoryType.) |
![]() ![]() | Tables |
Gets a collection of tables that are immediate children of the story.
(Inherited from InlineStory.) |
Name | Description | |
---|---|---|
![]() ![]() | Accept |
Accepts a visitor.
(Overrides NodeAccept(DocumentVisitor).) |
![]() ![]() | AddReply |
Adds a reply to this comment.
|
![]() ![]() | AppendChild |
Adds the specified node to the end of the list of child nodes for this node.
(Inherited from CompositeNode.) |
![]() ![]() | Clone | (Inherited from Node.) |
![]() ![]() | EnsureMinimum |
If the last child is not a paragraph, creates and appends one empty paragraph.
(Inherited from InlineStory.) |
![]() | Equals | (Inherited from Object.) |
![]() ![]() | GetAncestor(Type) |
Gets the first ancestor of the specified object type.
(Inherited from Node.) |
![]() ![]() | GetAncestor(NodeType) |
Gets the first ancestor of the specified NodeType.
(Inherited from Node.) |
![]() ![]() | GetChild |
Returns an Nth child node that matches the specified type.
(Inherited from CompositeNode.) |
![]() ![]() | GetChildNodes |
Returns a live collection of child nodes that match the specified type.
(Inherited from CompositeNode.) |
![]() ![]() | GetEnumerator |
Provides support for the for each style iteration over the child nodes of this node.
(Inherited from CompositeNode.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() ![]() | GetText |
Gets the text of this node and of all its children.
(Inherited from CompositeNode.) |
![]() | GetType | (Inherited from Object.) |
![]() ![]() | IndexOf |
Returns the index of the specified child node in the child node array.
(Inherited from CompositeNode.) |
![]() ![]() | InsertAfter |
Inserts the specified node immediately after the specified reference node.
(Inherited from CompositeNode.) |
![]() ![]() | InsertBefore |
Inserts the specified node immediately before the specified reference node.
(Inherited from CompositeNode.) |
![]() ![]() | NextPreOrder |
Gets next node according to the pre-order tree traversal algorithm.
(Inherited from Node.) |
![]() ![]() | PrependChild |
Adds the specified node to the beginning of the list of child nodes for this node.
(Inherited from CompositeNode.) |
![]() ![]() | PreviousPreOrder |
Gets the previous node according to the pre-order tree traversal algorithm.
(Inherited from Node.) |
![]() ![]() | Remove |
Removes itself from the parent.
(Inherited from Node.) |
![]() ![]() | RemoveAllChildren |
Removes all the child nodes of the current node.
(Inherited from CompositeNode.) |
![]() ![]() | RemoveAllReplies |
Removes all replies to this comment.
|
![]() ![]() | RemoveChild |
Removes the specified child node.
(Inherited from CompositeNode.) |
![]() ![]() | RemoveReply |
Removes the specified reply to this comment.
|
![]() ![]() | RemoveSmartTags |
Removes all SmartTag descendant nodes of the current node.
(Inherited from CompositeNode.) |
![]() ![]() | SelectNodes |
Selects a list of nodes matching the XPath expression.
(Inherited from CompositeNode.) |
![]() ![]() | SelectSingleNode |
Selects the first Node that matches the XPath expression.
(Inherited from CompositeNode.) |
![]() ![]() | SetText |
This is a convenience method that allows to easily set text of the comment.
|
![]() | ToString | (Inherited from Object.) |
![]() ![]() | ToString(SaveFormat) |
Exports the content of the node into a string in the specified format.
(Inherited from Node.) |
![]() ![]() | ToString(SaveOptions) |
Exports the content of the node into a string using the specified save options.
(Inherited from Node.) |
A comment is an annotation which is anchored to a region of text or to a position in text. A comment can contain an arbitrary amount of block-level content.
If a Comment object occurs on its own, the comment is anchored to the position of the Comment object.
To anchor a comment to a region of text three objects are required: Comment, CommentRangeStart and CommentRangeEnd. All three objects need to share the same Id value.
Comment is an inline-level node and can only be a child of Paragraph.
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."));
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 builder.CurrentParagraph.AppendChild(newComment); // Add comment reply newComment.AddReply("John Doe", "JD", new DateTime(2017, 9, 25, 12, 15, 0), "New reply");