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!
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
...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
Copy link to clipboard
Copied
Thanks Russ, it works!!!
And yes, the forum sometimes is hard to use.
Regards and again thanks a lot!