Append Word Documents & Preserve Left Indent Value of a Style C# .NET | Keep Different Styles

Hello,

with Aspose.Words 20.9 (and 20.10) the left-indent of a style was lost after AppendDocument with ImportFormatMode.KeepDifferentStyles.

Can you please have a look: IndenLeftLostAfterAppendDocument.zip (135.3 KB)

Thanks and best regards,
Marco

@MarcoFrank1,

Specifying ImportFormatMode.KeepSourceFormatting solves the problem on our end. For more information, please refer to: Differences between ImportFormat Modes

C# Code:

Aspose.Words.Document newDoc = new Aspose.Words.Document();
newDoc.RemoveAllChildren();

ImportFormatOptions importOptions = new ImportFormatOptions() { IgnoreHeaderFooter = false, IgnoreTextBoxes = false, KeepSourceNumbering = true };
Aspose.Words.Document doc = new Aspose.Words.Document("C:\\temp\\IndenLeftLostAfterAppendDocument\\StyleToBeAppended.doc");
newDoc.AppendDocument(doc, ImportFormatMode.KeepSourceFormatting, importOptions);

newDoc.Save("C:\\temp\\IndenLeftLostAfterAppendDocument\\20.10-KeepSourceFormatting.doc");

Thank you for your answer, But changing the option to ImportFormatMode.KeepSourceFormatting is not a option for our project. This brings other problems, like I additionally mentioned in Append documents with KeepDifferentStyles uses ‘Normal’ style using C#.

With Aspose.Words 17.1 the style (inclusive left-ident) was kept. When using the option KeepDifferentStyles, the expectation is to keep the styles (inclusive left-indent).

@MarcoFrank1,

We have logged this problem in our issue tracking system. Your ticket number is WORDSNET-21218 . We will further look into the details of this problem and will keep you updated on the status of the linked issue. We apologize for any inconvenience.

The issues you have found earlier have been fixed in this Aspose.Words for .NET 20.12 update and this Aspose.Words for Java 20.12 update.