Save two richtextbox contents into a file

  • Thread starter Thread starter Ang
  • Start date Start date
A

Ang

Hi,

How can I save two richtextbox contents into a file?

if simply join two richtextboxes like joining two string, the output
file will not show the value of second richtextbox.

Thanks for reply.
 
if simply join two richtextboxes like joining two string, the output
file will not show the value of second richtextbox.

Solution 1:

Check the RTF format specification. If you manage to extract the text
body part of the second RTF document, you can insert it just before the
last closing "}" character of the first document.

The tricky part is to find the start of the text body: save the RTF to a
file and open it with notepad. If you can find the first location of a
"\plain" or "\pard" token, try to extract everything from there until
the end (without the last "}")

Solution 2:

Short description: create an invisible RichTextBox and use the clipboard
methods to copy and paste the content of the two other RichTextBoxes
into this box.

Hope this helps (tm)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top