Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
Is possible to paste plain text from word into richtextbox and save it into my database field as formatted text ?
Posted
Comments
OriginalGriff 24-Nov-13 5:40am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Where is the formating to come from? If it is "plain text" then that implies there is no formatting...
Use the "Improve question" widget to edit your question and provide better information.

You can paste text into the RichTextBox but it will not be formatted "automatically" - see comment from OriginalGriff.

Once you have applied the formatting you can save the text with formatting to the database by using the RichTextBox.Rtf property
reference information[^]

[Edit]
You can find examples of formatting the richtextbox text at dotnetcurry[^] for example.

Or you could do the formatting in Word before you cut&paste

The rich text box will do the conversion to rtf for you
[/Edit]
 
Share this answer
 
v2
Comments
carlosrm99 24-Nov-13 8:18am    
Well, if I type text directly into the RichTextBox I record in the database without problems. I recorded this way
con.Open
com = New OleDbCommand ("UPDATE MyTable SET Text1 = '" & TextBox1.Rtf & "' WHERE ......)
the problem that I cannot solve is when I copy plain text from word and paste in my richtextbox insert that text in my field database.
I dont know how to convert text to rtf format.
Thanks.
CHill60 24-Nov-13 9:08am    
See my updated solution
Hi
I have read the data in the following links and there is some useful information in it:

insert-image-at-cursor-in-richtext-box[^]

insert text into a specific position in richtextbox[^]

best regards
 
Share this answer
 
v2
Comments
CHill60 24-Nov-13 7:50am    
I followed these links and neither of them mention storing formatted richtextbox text into a database!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900