473,767 Members | 4,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save two richtextbox contents into a file

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.

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #1
1 2298
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)
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphiâ„¢ and for the Javaâ„¢ platform
http://www.mikejustin.com - http://www.betabeans.de
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11263
by: Maya | last post by:
Hey, there! I'm new to vb.net and it seems I wouldn't be able to solve this without help. I have a pipe delimited file that has to be saved in txt format so it could be accepted by my DTS package. If I open and save the file manualy in Wordpad - it works. (not in Notepad otherwise formatting is changed and DTS package won't accept it.)
5
10542
by: Alvo von Cossel I | last post by:
hi, i have a word processor with a richtextbox in the center of the screen. if you paste an image into the richtextbox, it will appear. however, with my openfiledialog, only some text will appear (the url of the image). here is my code: if(openfiledialog1.showdialog()==dIALOGRESULT.OK) { RICHTEXTBOX1.TEXT=RICHTEXTBOX1.TEXT+OPENFILEDIALOG1.FILENAME;
2
1282
by: Tim Smith | last post by:
I have a program that I want to open a file and then save it as a different type (i.e. open a .txt file and save it as a RTF). How can I do this programatically?
6
3457
by: Just Me | last post by:
I've seen code that copies a bmp file into a RichTextBox by first putting it into the clipboard and then using Paste to get it into the RichtextBox. This destroys the clipboard contents. Is there an easy way to save the clipboard contents and then restore it? Thanks
3
4590
by: Tom Sweet | last post by:
Hi I know how to use the bitmap and graphics objects to create bitmaps and write text on them with the drawString method. I now need to create some BMPs of word or RTF docs. What would be the best approach here as I need to maintain most if not all of the formatting. The docs will be about 3 paragraphs each. Should I save the docs to rtf, then parse the rtf into the draw string method? There has to be an easier way.
0
11158
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct STRUCT_RECT
8
8570
by: Paul | last post by:
Hi, My VB is very rusty I'm afraid! What would be the most efficient way to remove the following ASCII characters from a string? à è ì ò ù À È Ì Ò Ù á é í ó ú ý Á É Í Ó Ú Ý â ê î ô û Â Ê Î Ô Û ã ñ õ Ã Ñ Õ ä ë ï ö ü ÿ Ä Ë Ï Ö Ü Y o O æ Æ
9
4878
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how can I print out this content to printer easily? Thanks! James
1
2596
by: txomin | last post by:
Hi all, Following the instructions of this link http://support.microsoft.com/kb/812425, i've been able to print the content of a RichTextBox control . Apart from that , I want to have the chance to create and save a file with the content of the RichTextBox. I've read a thread (http://www.thescripts.com/forum/thread159382.html) and i've been able to create files. But those files don't have any extension and I dont know how I can open them. I...
0
9575
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.