How can I combine several RTFs into a single file

General TRichView support forum. Please post your questions here
Post Reply
WilliamPreom
Posts: 1
Joined: Sat Nov 20, 2021 5:51 pm
Location: Iraq
Contact:

How can I combine several RTFs into a single file

Post by WilliamPreom »

Hello Sergey,

How can I combine several RTFs into a single file - the example is only for RVFs & I cannot see any procedure like InsertRTFFromStream...

Thanks,

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

Re: How can I combine several RTFs into a single file

Post by Sergey Tkachenko »

LoadRTF and LoadRTFFromStream methods do not clear an existing document.
So, just call LoadRTF for each file you want to merge, then call Format.
standay
Posts: 256
Joined: Fri Jun 18, 2021 3:07 pm

Re: How can I combine several RTFs into a single file

Post by standay »

Sergey Tkachenko wrote: Tue Nov 30, 2021 12:15 pm LoadRTF and LoadRTFFromStream methods do not clear an existing document.
So, just call LoadRTF for each file you want to merge, then call Format.
Sergey, is that the same for RVF format files as well? Or do you have to use append?

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

Re: How can I combine several RTFs into a single file

Post by Sergey Tkachenko »

It's the same for DocX format, but not for RVF.
LoadRVF and LoadRVFFromStream clear document before loading.
However, for RVF, additional methods are available: InsertRVFFromStream (not in the caret position but at the specified index) and AppendRVFFromStream.
Here is the example for RVF: https://www.trichview.com/forums/viewto ... ?f=3&t=272
standay
Posts: 256
Joined: Fri Jun 18, 2021 3:07 pm

Re: How can I combine several RTFs into a single file

Post by standay »

Sergey Tkachenko wrote: Wed Dec 01, 2021 12:11 pm It's the same for DocX format, but not for RVF.
LoadRVF and LoadRVFFromStream clear document before loading.
However, for RVF, additional methods are available: InsertRVFFromStream (not in the caret position but at the specified index) and AppendRVFFromStream.
Here is the example for RVF: https://www.trichview.com/forums/viewto ... ?f=3&t=272
Thanks Sergey, that's what I thought but wanted to confirm. I used both the insert and append methods for RVF in my app.

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

Re: How can I combine several RTFs into a single file

Post by Sergey Tkachenko »

I agree that it's not consistent, but it's too late to change it.
Post Reply