Hi Team ,
Please let me know , how to get the total number of tabs or space occupied before the bullet points (including nested bullet points)
Thanks in advance
//load word document
Document document = new Document();
document.LoadFromFile(fileDir + "\\test.docx");
//get the section
Section section = document.Sections[0];
//loop through paragraphs
foreach (Paragraph paragraph in section.Body.Paragraphs)
{
//judge if the paragraph contains list
if (paragraph.ListFormat.ListType != ListType.NoList)
{
//get number position
float numberPosition = paragraph.ListFormat.CurrentListLevel.NumberPosition;
}
}
for(int i = 0;i<doc.getSections().getCount();i++) {
for (int j = 0; j < doc.getSections().get(i).getParagraphs().getCount(); j++) {
Paragraph paragraph = doc.getSections().get(i).getParagraphs().get(j);
if (paragraph.getListFormat().getListType() != ListType.No_List) {
leftIndent= paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().getLeftIndent();
System.out.println("postion of " + paragraph.getText() + " " + leftIndent);
}
}
}