Insert RTF at the current line in TRichView

General TRichView support forum. Please post your questions here
Post Reply
vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Insert RTF at the current line in TRichView

Post by vit » Wed Sep 06, 2017 10:24 am

Hi!

I need to insert RTF into TRichView at the current line, without a new line. In TRichViewEdit I use InsertRTFFromStreamEd and it works fine. But TRichView.LoadRTFFromStream does the new line. Do I need to adjust any settings to avoid inserting at the new line?

Thanks!

Sergey Tkachenko
Site Admin
Posts: 13584
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Insert RTF at the current line in TRichView

Post by Sergey Tkachenko » Wed Sep 06, 2017 11:25 am

Do you mean a blank line before the loaded content?
LoadRTFFromStream adds new content to the end, it does not clear existing content, so call Clear before LoadRTFFromStream.

Or do you want to add RTF content to the end of existing paragraph?

vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Re: Insert RTF at the current line in TRichView

Post by vit » Wed Sep 06, 2017 11:26 am

Or do you want to add RTF content to the end of existing paragraph?
Yes I ment that

Sergey Tkachenko
Site Admin
Posts: 13584
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Insert RTF at the current line in TRichView

Post by Sergey Tkachenko » Wed Sep 06, 2017 11:38 am

Unfortunately, there are no methods for this.
You can
1) Use TRichViewEdit instead of TRichView, use InsertRTFFromStreamEd, then assign ReadOnly = True.
2) Load RTF in a temporal hidden TRichView, save it as RVF (SaveRVFToStream), then use AppendRVFFromStream, with ParaNo parameter = -1. But it allows adding content only to the last paragraph.

vit
Posts: 114
Joined: Tue Feb 03, 2009 3:11 pm

Re: Insert RTF at the current line in TRichView

Post by vit » Wed Sep 06, 2017 11:40 am

Ok, thanks!

Post Reply