• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set Change Bar to TextRange with ExtendScript

Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Hi community,

Is there a way to set Change Bar to a TextRange using ExtendScript?
I have found a way to set Change Bar to Pgf but can not find how to do the same with TextRange.

function setChangeBar(oTextRange) {
  if (!oTextRange) return 
  var pgf = oTextRange.beg.obj
  pgf.ChangeBar = 1;
}

 

Thanks.

Views

293

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

Community Expert , Nov 18, 2021 Nov 18, 2021

Assuming that textRange is a valid TextRange, you use something like this:

var prop;
prop = new PropVal ();
prop.propIdent.num = Constants.FP_ChangeBar;
prop.propVal.valType = Number;
prop.propVal.ival = 1;
doc.SetTextPropVal (textRange, prop);

For best practice I would encapsulate this into a function, perhaps called applyChangeBar, and pass in the TextRange and Doc objects whenever I want to apply a change bar to a range of text.

Votes

Translate

Translate
Community Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Assuming that textRange is a valid TextRange, you use something like this:

var prop;
prop = new PropVal ();
prop.propIdent.num = Constants.FP_ChangeBar;
prop.propVal.valType = Number;
prop.propVal.ival = 1;
doc.SetTextPropVal (textRange, prop);

For best practice I would encapsulate this into a function, perhaps called applyChangeBar, and pass in the TextRange and Doc objects whenever I want to apply a change bar to a range of text.

Votes

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
Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

LATEST

Thank you very much.

Votes

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