Dear Team,
I am using aspose word java , i want get first paragraph of the document.
Condition of getting first paragraph:
- First paragraph should not be empty paragraph
2)First paragraph should not field codes
Thanks in advance,
Kesavaraman 02_chapter.zip (37.7 KB)
4_Chapter.zip (57.3 KB)
@keshav07
In your case, we suggest you following solution.
- Please use Body.Paragraphs property to get the collection of paragraph in a section.
- Iterate over paragraph nodes and check either it is empty or not. You can use Paragraph.HasChildNodes to check either is is empty or not.
- To check if paragraph has field, you can use Paragraph.Range.Fields.Count property.
Hope this helps you.