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

Free Support Forum - aspose.com

Issue with ImportFormatModes and List Bullet Styles

Hello,

We have experienced an issue while attempting to use either the KeepDifferentStyles or KeepSourceFormatting ImportFormatMode. Specifically, after merging two documents (attached), the styling of one particular section within the resulting document (attached) appears to have been generated incorrectly, per the ImportFormatMode documentation. A new style was created, but this style has different properties than that of the source document. Moreover, the two subsequent bullets points were assigned the correctly generated style.

Samples.zip (266.1 KB)

Sample Code Snippet which references Aspose.Words 17.8.0.0

private void button1_Click(object sender, EventArgs e)
{
    string strFolderPath = @"C:\Users\krassimir.manolov\Documents\Samples\";

    string document1 = strFolderPath + "Opening-2722_Source.docx";
    string document2 = strFolderPath + "US Naglazyme Long-Term Efficacy.docx";

    Document srcDoc = new Document(document1);
    Document dstDoc = new Document(document2);

    srcDoc.AppendDocument(dstDoc, ImportFormatMode.KeepSourceFormatting);
    srcDoc.Save(strFolderPath + "Results_KeepSourceFormatting.docx");
}

Documentation: https://reference.aspose.com/net/words/aspose.words/importformatmode

Do you know whether this issue has been addressed in a newer release?

Thank you,
Krassimir

@kmanol

Thanks for your inquiry. We have tested the scenario using the latest version of Aspose.Words for .NET 19.1 and have not found the shared issue. So, please use Aspose.Words for .NET 19.1. We have attached the output document with this post for your kind reference. Results_KeepSourceFormatting.zip (79.2 KB)