Link to home
Start Free TrialLog in
Avatar of Rahul Bagal
Rahul BagalFlag for India

asked on

concatenate the RTF text

I am stroring the RTF text in the long type field of oracle

rs!textrtf= richtextbox1.textRTF

then restoring

richtextbox1.textRTF=rs!textrtf

Now I want to concatenate no of RTF texts from database and show them in a rich textbox  as a single document without loosing formating

can you please help me ?

Avatar of Rahul Bagal
Rahul Bagal
Flag of India image

ASKER

Also How can I Insert this in the active document of Word to print ?
Avatar of Basker
Basker

An easy way is to have a RichTextBox object in your program ( in a temp form or as an object).
say, you have the rtf in a string as rtf1
you need to concat rtf2 to rtf1

Richtextbox1.selrtf = rtf1
richtextbo1.selrtf = richtextbo1.selrtf + rtf2

Now you can take the rtf text from the Richtextbox as richtextbox1.selrtf and store it in the database.

Another options

You need to remove the ending tag of a Rtf content \para} and the starting tag of the second text,concat them and save.
this Does not work . I write a test  program

Dim rtf1, rtf2 As String

Private Sub Command1_Click()
rtf1 = RichTextBox1.TextRTF
rtf2 = RichTextBox2.TextRTF
RichTextBox3.SelRTF = rtf1
RichTextBox3.SelRTF = RichTextBox3.SelRTF + rtf2
End Sub

Invain..

Can you pleas tell me which is  starting & Ending  tag of the rtf text and which I should concatenate
This is sample RTF..

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss MS Sans Serif;}}
{\colortbl\red0\green0\blue0;}
\deflang1033\pard\plain\f2\fs17 SAMPLE RTF TEXT
\par
\par }
ASKER CERTIFIED SOLUTION
Avatar of Asmitapatil
Asmitapatil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Asmita
This really worked out