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

pgfFmt.Start property not working

New Here ,
Jul 07, 2015 Jul 07, 2015

Copy link to clipboard

Copied

Hello guys:

I´ve tried this using FM 10 and FM 11 (unstructured), and it fails in both versions. The PgfFmt "Body" is shown as modified in FM (asterisk) but the Paragraph Designer shows the old Start property.

I need to update the "Start" PgfFmt property. I am using a shared code that works with the rest of PgfFmt properties.

source: (http://extendingframemaker.blogspot.com/2011/10/updating-paragraph-format.html)

var doc = app.ActiveDoc;

var tframe = doc.MainFlowInDoc.FirstTextFrameInFlow;

var pgfFmt = doc.GetNamedObject(Constants.FO_PgfFmt, "Body");

if (pgfFmt.ObjectValid) {

    pgfFmt.Start= Constants.FV_PGF_ANYWHERE;

    var formatFlags = Constants.FF_UFF_PGF | Constants.FF_UFF_REMOVE_EXCEPTIONS;

    doc.SimpleImportFormats (doc, formatFlags);

}

The document is already saved in my HD, so it exists. What is wrong?

Thanks!

TOPICS
Scripting

Views

286

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 , Jul 09, 2015 Jul 09, 2015

Hi SFRIP,

I was able to confirm this behavior. It seems like a bug to me. Other paragraph properties apply correctly but this one does not. The only way I could get the Start property to apply was to iterate over all paragraphs and reapply the whole format:

pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

while(pgf.ObjectValid())

{

    if(pgf.Name == "Body")

    {

        pgf.SetProps(pgfFmt.GetProps());

    }

    pgf = pgf.NextPgfInFlow;

}

Hope that sample comes through OK. Incredibly, th

...

Votes

Translate

Translate
Mentor ,
Jul 09, 2015 Jul 09, 2015

Copy link to clipboard

Copied

Hi SFRIP,

I was able to confirm this behavior. It seems like a bug to me. Other paragraph properties apply correctly but this one does not. The only way I could get the Start property to apply was to iterate over all paragraphs and reapply the whole format:

pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;

while(pgf.ObjectValid())

{

    if(pgf.Name == "Body")

    {

        pgf.SetProps(pgfFmt.GetProps());

    }

    pgf = pgf.NextPgfInFlow;

}

Hope that sample comes through OK. Incredibly, this forum editor continues to get harder to use.

Russ

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
New Here ,
Jul 11, 2015 Jul 11, 2015

Copy link to clipboard

Copied

LATEST

Thanks Russ, it works!!!

And yes, the forum sometimes is hard to use.

Regards and again thanks a lot!

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