Highlighted

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?

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

TOPICS
Scripting

Views

142

Likes

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

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?

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

TOPICS
Scripting

Views

143

Likes

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
Jun 26, 2017 0
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
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 27, 2017 0