How to create a new Conditional Format?

New Here ,
Jun 26, 2017 Jun 26, 2017

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

162

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Mentor , Jun 27, 2017 Jun 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

Likes

translate

Translate

Translate
Mentor ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

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

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines