ParagraphNodeType Property |
Namespace: Aspose.Words
Document doc = new Document(MyDir + "Document.docx"); // 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));