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

Free Support Forum - aspose.com

Cannot add style because style name already exists - Aspose Words

Hello

We have code which copies several source .docs into one main Aspose .doc. One of the source .docs is causing the attached Aspose Error, complaining 'Cannot add style because style name already exists'

I've zipped the full error, incl. the code where the error occurs. I've added the source .doc that causes the error, and what the final main document contains (minus the problem source .doc).

Please can you help to see why Aspose Words 5.2.2.0 is giving this error?

Thanks and Regards

Jacqui

Hi

Thanks for your inquiry. I can’t reproduce this issue on my side. I used the following code:

Document dst = new Document(@"Test085\WithoutTheProblemPart.doc");

Document src = new Document(@"Test085\TheProblemPart.doc");

AppendDoc(dst, src);

dst.Save(@"Test085\out.doc");

I use Aspose.Words 5.2.2 for testing.

Best regards.

Ok - it’s still being annoying because it’s still happening inconsistently. but thanks for having a look anyway.

Hi

Thanks for your request. The same issue (#3658) was fixed in Aspose.Words 5.2.2. So please make sure that you are using 5.2.2 version.

Also you can attach documents that will allow reproducing this issue on my side.

Best regards.