The format of Paragragh had been changed after combined document using the standard method

Hi guys
We encountered a problem when merging documents by using Aspose.Word which version is 2022.11 . The code is C# and attachments are shown below.

Document src = new Document("d:\\sub.docx");
Document dest = new Document("d:\\main.docx");
            
dest.AppendDocument(src ,ImportFormatMode.KeepSourceFormatting );
dest.Save("d:\\combined.docx", SaveFormat.Docx);

combined.docx (2.4 MB)
main.docx (525.6 KB)
sub.docx (2.4 MB)

The name of the problem document is combined.docx. Please switch to page 5. The position shown in the red box in the screenshot below shows that the header line of the original document sub.docx has no color. After merging the document, it turns orange.

@wengyeung
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25032

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

As a temporary workaround you can use ImportFormatMode.KeepDifferentStyles:

Document src = new Document(@"C:\Temp\sub.docx");
Document dest = new Document(@"C:\Temp\main.docx");
dest.AppendDocument(src, ImportFormatMode.KeepDifferentStyles);
dest.Save(@"C:\Temp\out.docx", SaveFormat.Docx);

in this case the text color is not changed after appending documents.

The issues you have found earlier (filed as WORDSNET-25032) have been fixed in this Aspose.Words for .NET 23.4 update also available on NuGet.

Dear Sir
We have recently upgraded Aspose After the Word component into 24.09, there was a new issue. As our code was still using the temporary configuration you suggested earlier.
when I merged the report named ‘combined.docx’, I opened and saved it as a new document ‘combined2.docx’, then closed and reopened the new document. I found that there was an issue with the indentation of paragraphs, as indicated by the red circle below.

The code is as follows

Document src2 = new Document("C:\\temp\\src.docx");
Document dest = new Document("C:\\temp\\target.docx");
dest.AppendDocument(src2, ImportFormatMode.KeepDifferentStyles );
dest.Save("c:\\temp\\combined.docx");

combined.docx (24.2 KB)

src.docx (19.9 KB)

target.docx (25.7 KB)
combined2.docx (28.2 KB)

@wengyeung The problem is not reproducible on my side using the latest 24.11 version of Aspose.Words. Please try using the latest version on your side and let us know if the problem is still reproducible.

Dear Sir
we upgraded the version into24.11.1 and run the program , open the combined document and save it as a new one ,then open the new one ,you can find indentation had been changed as bellow .

image.png (6.0 KB)

image.png (10.4 KB)

@wengyeung
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27635

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.