Clean Up a Document
Sometimes you may need to remove unused or duplicate information to reduce the size of the output document and processing time.
While you can find and remove unused data, such as styles or lists, or duplicate information manually, it will be much more convenient to do this using features and capabilities provided by Aspose.Words.
Remove Unused Information from a Document
You can use the UnusedLists property to detect and remove lists and list definitions that are marked as “unused”.
The following code example shows how to remove only unused styles from a document:
Remove Duplicate Information from a Document
You can also use the DuplicateStyle property to substitute all duplicate styles with the original one and remove duplicates from a document.
The following code example shows how to remove duplicate styles from a document: