How to create a new Conditional Format?

New Here ,
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

157

Likes

Translate

Translate

Report

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

1 Correct Answer

Mentor , Jun 27, 2017
Russ Ward Mentor , 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
Jump to answer Jump to answer
Mentor ,
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

Report

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