Insert a paragraph object somewhere else
Dear friends, It seems that I stretch my knowledge to far...
I have collected footnotes in an array aoFNcollected.
A heading has already be placed: oPgf
Now I want to place the FN paragraphs to a new place forming endnotes (remember, a footnote can contain more than 1 paragraph).
for (j = 0; j < nNotes; j++) {
oFn = aoFNcollected
; // Fn to be handled now oFnPgf = oFn.FirstPgf; // first ¶ in footnote
oPgf = oDoc.NewSeriesPgf(oPgf); // new empty ¶ in doc
oDoc.TextSelection = oFnPgf; // this does not work - halt of script
oDoc.Copy(0); // copy Fn para
oTL = new TextLoc (oPgf, 0);
oTR = new TextRange(oTL, oTL);
oDoc.TextSelection = oTR;
oDoc.Paste(); // paste Fn para
Fno_ApplyPgfFmt (oDoc, oPgf, goFno.FmtEn) // apply ¶ format zen-endnote
// further code not yet verified - just showing my intention
oFnPgf = oFnPgf.NextPgfInFlow; // ??? is a FN also a flow of its own ???
while (oFnPgf.ObjectValid()) { // a footnote can have multiple paragraphs
oPgf = oDoc.NewSeriesPgf(oFnPgf);
Fno_ApplyPgfFmt (oDoc, oPgf, goFno.FmtEnCont) // apply ¶ format zenc-endnote-continue
oFnPgf = oFnPgf.NextPgfInFlow; // get next ¶ from footnote
}
}
I tried to use the copy/paste method - but obviously line 05 does not provide a TextSelection, because the object comes from an array and not from the document.
But how can I place a Pfg object to a new place defined by a new Pgf (line 04)?

