Clearing the “clearOverrides(Priority Options?)” code does not work
- January 1, 2025
- 2 replies
- 860 views
I've tried some codes on the internet and they all failed. There doesn't seem to be any online for individual tables.
A. I am trying to clear the table style “Preferred Options”.
B, cell styles “preferred options”, “non-custom style properties”.
C. Paragraph styles “Preferred Options”.
D. Apply character style “none”.
For example, this sentence wants to clear the cell style priority.
myTable.everyItem().cells.everyItem().paragraphs.everyItem().clearOverrides(myOverrideType);
I have a feeling it's the front of clearOverrides that's wrong.
Someone would like to point it out.
Here's a script that's a little complicated.
Is there anything that can be done in a couple of sentences?
https://raw.githubusercontent.com/grefel/clearOverrides/refs/heads/master/ClearStyleOverrides.jsx
I added these two lines and it seemed to work, but the “undefined style attribute” was not cleared.
myTable.clearTableStyleOverrides();
myTable.cells.everyItem().clearCellStyleOverrides();

