Hi Team,
We are looking at updating the lists present in a OOXML based .
As part of the updates we are recieving abstractNumId and numID for the list and few attribute values.
I am not sure how to access abstractNumId to update the list settings. I can see the list Id is accessing numId alone. Can you please help
@ManasaVTR There is no way to access abstractNumid
using Aspose.Words public API. Since it’s value is not fixed it might be changed after document open/save operation. You can access list id using List.ListId property.
Thanks Alexey. Could you please suggest the best approach to access a list in the document using Aspose to perform updates for list formatting ?
Should we access via styleID ? . I am attaching the OOXML for which we want to perform these updates .
LeaseOfOfficeWhole_docx 2.zip (156.0 KB)
@ManasaVTR You can simply loop through the list in the document and modify them:
Document doc = new Document("C:\\Temp\\in.docx");
for (com.aspose.words.List lst : doc.getLists())
{
// Modify list levels.
for (ListLevel lvl : lst.getListLevels())
{
// Chage list level properties
// ....
}
}
doc.save("C:\\Temp\\out.docx");
Please see our documentation to learn how to work with lists:
https://docs.aspose.com/words/java/working-with-lists/