Free Support Forum -

Style lost after field removal in table


If option MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS is set then default style “Normal” is applied for empty (absent) fields in the table. (22.1 KB)

Attached are:

  1. Input document “test.docx”
  2. Java code which fills table “Table1” with values. Please note that a title “My title” should appear only in the first row.
  3. Output document “out.docx”.
    In rows 2/3/4 the title is empty (this is correct) but its style is “Normal” with font size 12 although it should be 7.

How is it possible to inform Aspose.Words to keep the existing style (at least font name and font size) for merge fields with empty values?

Best regards, Evgeniy


Thanks for your inquiry. We have tested the scenario using Aspose.Words for Java 18.2 and have not found the shared issue. Please upgrade to the Aspose.Words for Java 18.2. We have attached the output DOCX with this post for your kind reference. (8.3 KB)