Skip to main content
Known Participant
June 26, 2017
Answered

How to create a new Conditional Format?

  • June 26, 2017
  • 1 reply
  • 357 views

How to create a new Conditional Format Tag with default Style/Color/Background using ExtendScript?

This topic has been closed for replies.
Correct answer Russ Ward

Varun,

Very simple. If you have the document object:

var condFmt = doc.NewNamedCondFmt("SomeFormatName");

The new condition will have all "as-is" settings... that is, no color, style, etc. If you want to add style overrides, it is fairly simple. For example, to give the condition a red color and strikethrough text:

condFmt.SepOverride = doc.GetNamedColor ("Red");

condFmt.StyleOverride = Constants.FV_CN_STRIKETHROUGH;

This assumes that a color named "Red" exists in the document.

Russ

1 reply

Russ WardCorrect answer
Legend
June 27, 2017

Varun,

Very simple. If you have the document object:

var condFmt = doc.NewNamedCondFmt("SomeFormatName");

The new condition will have all "as-is" settings... that is, no color, style, etc. If you want to add style overrides, it is fairly simple. For example, to give the condition a red color and strikethrough text:

condFmt.SepOverride = doc.GetNamedColor ("Red");

condFmt.StyleOverride = Constants.FV_CN_STRIKETHROUGH;

This assumes that a color named "Red" exists in the document.

Russ