Skip to main content
Participating Frequently
July 16, 2018
Question

Update Style of CharFmt

  • July 16, 2018
  • 1 reply
  • 362 views

Hi All,

It is easily possible to change with Pod "Character Designer" a property of a character format.
For example, in a template file of a FM book, when a character style is selected, the change of one property, e.g. color, could be updated with "Update Style" button when the cursor position is not in a particular paragraph of a body page. Next action will be to either retain or remove overrides.

With javascript code it is possible to change as well color red of a character format to black.

var charfmt = doc.GetNamedCharFmt(varcol);

        // var chrfmt = doc.GetNamedObject(Constants.FO_ChrFmt, varcol);

        if (charfmt.ObjectValid() == true)

            {

                            charfmt.Color = "Black";

      }

But is it also possible to use a javascript function equivalent to "Update Style, "Retain Overrides" or "Remove Overrrides" buttons?

Marc

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
July 16, 2018

You can use the following code to update all occurrences of the Character Format in the document and remove overrides:

doc.SimpleImportFormats (doc, Constants.FF_UFF_FONT | Constants.FF_UFF_REMOVE_EXCEPTIONS);

-Rick

www.frameexpert.com