I am using the document visitor model, but maybe section is the wrong word. There is only one Aspose section in the document. I am refering to the table of contents and the titles. As suggested, I am using the following code to get each Word section heading (which works well):-
private bool CheckIsHeader(Run run)
{
Paragraph para = (Paragraph)run.GetAncestor(typeof(Aspose.Words.Paragraph));
return para != null && (para.ParagraphFormat.StyleIdentifier == StyleIdentifier.Heading1 || para.ParagraphFormat.StyleIdentifier == StyleIdentifier.Heading2);
}
but how do I get the word section heading number eg 1, 1.1, 1.2, 1.2.1 etc ?