CommentNodeType Property
Returns NodeType.Comment.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
public override NodeType NodeType { get; }

Property Value

Type: NodeType
Shows how to retrieve the NodeType enumeration of nodes.
Document doc = new Document(MyDir + "Document.doc");

// Let's pick a node that we can't be quite sure of what type it is.
// In this case lets pick the first node of the first paragraph in the body of the document
Node node = doc.FirstSection.Body.FirstParagraph.FirstChild;
Console.WriteLine("NodeType of first child: " + Node.NodeTypeToString(node.NodeType));

// This time let's pick a node that we know the type of. Create a new paragraph and a table node.
Paragraph para = new Paragraph(doc);
Table table = new Table(doc);

// Access to NodeType for typed nodes will always return their specific NodeType. 
// i.e A paragraph node will always return NodeType.Paragraph, a table node will always return NodeType.Table.
Console.WriteLine("NodeType of Paragraph: " + Node.NodeTypeToString(para.NodeType));
Console.WriteLine("NodeType of Table: " + Node.NodeTypeToString(table.NodeType));
See Also