I have a very simple test where I am opening an input document and Copies styles from the input1.xml & input2.xml to the input.docx document and imported all content into the input.docx document.
After that, I used Document.Cleanup() with the following options
CleanupOptions cleanupOptions = new CleanupOptions(); cleanupOptions.DuplicateStyle = true; cleanupOptions.UnusedStyles = true; cleanupOptions.UnusedLists = true; document.Cleanup(cleanupOptions);
But all unused styles and lists are not removed after Cleanup().
I have created a sample demo application to reproduce this issue, PFA.
SampleCode.zip (42.2 KB)