Cannot remove unused style

Hi,
i want to import a table with a style that is already existing in the destination document.
So i have to use ‘ImportFormatMode_KeepSourceFormatting’ because the style has been updated.
But now the style is copied to ‘MyStyle_1’. Is it possible to overwrite an existing style or to remove the current before i
import a new one ?
Kind regards,
Guido

Hi Guido,

Thanks for your inquiry.

When you use the KeepSourceFormatting option and if a matching style already exists in the destination document, the source style is copied and given a unique name by appending a suffix number to it, for example “Normal_0” or “Heading 1_5”. On the other hand, you can use the UseDestinationStyles option. In this case, if a matching style already exists in the destination document, the style is not copied and the imported nodes are updated to reference the existing style.

Secondly, we have introduced RemoveUnusedResources method in Document class to remove any unused styles and lists from the document. Please see the following code:

Document doc = new Document();
doc.RemoveUnusedResources();
doc.Save("");

I hope, this helps.

Best regards,

Hi,
unfortunately we cannot remove any style which is unused.
we need a function that replace the current style because we want to update it. Is there any function to update a style ? Or any way to solve this issue ?
Kind regards,
Guido

Hi Guido,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support removing particular styles from documents. Your request has been linked to the appropriate issue (WORDSNET-2304) and you will be notified as soon as this feature is supported. May be you should just change settings of existing style. I think this approach is better.

Best regards,

The issues you have found earlier (filed as WORDSNET-2304) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(18)