Question on Dynamically building a document

  • I have existing code which works as I want it. I'm having a user build a document, then i'm saving the document in a totally custom format for reasons we do not need to get into at this point. Suffice it to say - it would be easier to save as RTF but that's not possible.

    Anyway, now i'm working on the code which loads these documetns and then rebuilds the document in the WPTools editor. I have pretty much everythign working perfectly except for TWPTextObjs.

    I think the problem i'm running into is due to where the cursor moves to as I'm building the document. Quick question - how do I ensure that after I append a paragraph and set the text, that the cursort/insertion point is always at teh end of the document?

    Thanks,

    Alan

    • Offizieller Beitrag

    Hi,

    Usually I do not recommend to use cursor operations to load a document. If it is not possible to build a custom reader (See WPIOANSI for a start) it must be possible to use par references (TParagraph object) to build it.

    TParagraph has all the methods which are required, such as Append, Inser, AppendObject etc.

    Zitat

    I think the problem i'm running into is due to where the cursor moves to as I'm building the document. Quick question - how do I ensure that after I append a paragraph and set the text, that the cursort/insertion point is always at teh end of the document?

    WPRichText.TextCursor.MoveTo(lastpar, Lastpar.CharCount) does it.

    Julian