wpcubed.com Forum Index wpcubed.com
WPCubed GmbH Support Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on Dynamically building a document

 
Post new topic   Reply to topic    wpcubed.com Forum Index -> WPTools5 (VCL)
View previous topic :: View next topic  
Author Message
aolson



Joined: 19 Sep 2005
Posts: 43

PostPosted: Tue Mar 16, 2010 6:32 pm    Post subject: Question on Dynamically building a document Reply with quote

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
Back to top
View user's profile Send private message
wpsupport
Site Admin


Joined: 24 Oct 2003
Posts: 5658

PostPosted: Wed Mar 17, 2010 8:58 am    Post subject: Reply with quote

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.

Quote:
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    wpcubed.com Forum Index -> WPTools5 (VCL) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group