Table border is missing after accept all revisions

The table border is different withe accept revisions by office.
The codes:

String path = "C:\\Users\\z_jia\\Desktop\\a\\data\\";
Document word = new Document(path + "temp.docx");
var revisions = word.getRevisions();
revisions.acceptAll();
word.save(path + "result.docx");

result.docx (54.5 KB)

temp.docx (63.0 KB)

The doc was recepted by office:
temp.docx (63.0 KB)

@GusGus

Summary
Calling doc.getRevisions().acceptAll() can cause table borders to disappear or change in the saved document, as observed in similar cases where accepting tracked changes removed border formatting.

Why it happens
When a table’s borders are defined by a style or are part of tracked‑change markup, the accept‑all operation may clear that formatting. The revision‑accept process removes the style‑based border information, leaving the table without the expected border attributes.

What to do next

  1. Inspect border settings before and after accepting revisions
Document doc = new Document("temp.docx");

// Before accepting revisions
for (Table tbl : (Iterable<Table>) doc.getFirstSection().getBody().getTables()) {
System.out.println("Before accept – InsideH: " + tbl.getBorderInsideH().getLineStyle());
}

// Accept all revisions
doc.getRevisions().acceptAll();

// After accepting revisions
for (Table tbl : (Iterable<Table>) doc.getFirstSection().getBody().getTables()) {
System.out.println("After accept – InsideH: " + tbl.getBorderInsideH().getLineStyle());
}

This will show whether the border objects are being reset.

  1. Re‑apply the required borders after acceptAll()
Document doc = new Document("temp.docx");
doc.getRevisions().acceptAll();

// Re‑apply borders to every table
for (Table tbl : (Iterable<Table>) doc.getFirstSection().getBody().getTables()) {
// Outer border
tbl.getBorders().setLineStyle(LineStyle.SINGLE);
tbl.getBorders().setColor(Color.BLACK);
tbl.getBorders().setLineWidth(0.75); // points

// Inside horizontal border
tbl.getBorderInsideH().setLineStyle(LineStyle.SINGLE);
tbl.getBorderInsideH().setColor(Color.BLACK);
tbl.getBorderInsideH().setLineWidth(0.75);

// Inside vertical border
tbl.getBorderInsideV().setLineStyle(LineStyle.SINGLE);
tbl.getBorderInsideV().setColor(Color.BLACK);
tbl.getBorderInsideV().setLineWidth(0.75);
}

doc.save("result.docx");

Adjust the style, color, and width to match the original appearance.

  1. Create a minimal reproducible sample
    Build a small document containing a single table with a tracked change that modifies the border. Run the code above to verify whether the border loss still occurs. This sample can be used for further investigation or when reporting a bug.

  2. If the problem persists
    Gather the following information for a bug report:

  • The exact Aspose.Words for Java version you are using.
  • The minimal sample document that reproduces the issue.
  • The code snippet that triggers the border loss.

Providing these details will help the support or development team diagnose the problem.

Note: The behavior described aligns with known cases where accepting all revisions removed table border styling. If you observe different results, please verify the document’s border definitions (direct formatting vs. style‑based) and consider sharing the sample for deeper analysis.

:warning: I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.

@GusGus
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-28872

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.

Thanks, please let me know if it is fixed or there is any way to avoid it.

@GusGus Sure, we will keep you updated and let you know once the issue is resolved or we have more information for you.