We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

"Too many styles" question


I have recently encountered the dreaded “Too Many Styles” problem and have a question. Does the limit of 4096 refer to the defined styles or the count of times a style is applied? The problem arose when concatenating 2 documents with no more than a dozen or so styles defined, but multiple styles applied to each of 400+ lines.

Thanks in advance,
Frank Alviani

Hi Frank,

Thanks for your inquiry. Please call Document.RemoveUnusedResources method before saving the document. This method removes unused styles and lists from the document.

If you still face problem, please share your documents and code example to reproduce this issue at our end. We will investigate the issue and provide you more information on this.


I am updating an old product that was build with Aspose Words 10.0 (2011.04.30).
In what version did you add Document.RemoveUnusedResources, and secondly, will it still help me, even though all styles are being used? We just have multiple copies (1 per added document) of the same styles.

Göran Roseen

Sorry for not seraching the FAQ better, I think I can answer my own question.

It seems that ImportFormatMode.KeepDifferentStyles would solve my problem and I can see that it was added in Aspose Words 14.12.



Thanks for your inquiry. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.