Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Text to HTML

Status
Not open for further replies.

Kingcomtech

Programmer
Feb 21, 2005
1
US
I'm creating a small Email module and the area to write the body is a richtextbox control in a Windows Form. I want to take what's written and translate it into an html email.

I started using the RTF property, but was stumped. Any ideas?? Thanx..
 
If you can get to the raw RTF content, you could try and build a parse function to change it into HTML (maybe using regular expressions).


And then silence smacks right in there...
... And it is loud!
 
Thanks for the response, But it does not solve my problem. I basically need to see if there are changes that have been made to the text and depending on it save.
Iam basically checking if the text1.textchanged and it is true everytime even though I dont touch the textbox
 
Why bother with RTF? If you're trying to generate HTML, then write in HTML. There are really good HTML Edititor components for C# that deal with MSHTML. We tried the RTF option and it was not fun.
 
I also looked it up and textchanged is an event. It's triggered as soon as the text property is changed. To see if any changes are made you should write an eventhandler for this event (simply double-click the event in the designer to generate the handler) and then maintain a boolean variable yourself.

And then silence smacks right in there...
... And it is loud!
 
Thats exactly what I did. Wrote an event and assigned a variable. My problem is the variable is set to true even i dont change the text. the RTF introduces spaces and HTML changes by itself.

JurkMonkey,

We are unable to change the eidtor at this point. Guess I gotta use the RTF only.

Please Help!
 
The textchanged event is triggered by any changes to the property text. The changes can be made from the UI as well as from any code.
Maybe you should try and attacht the eventhandler at a later moment.
It would be helpfull if you could post some example code, demonstrating the problem.

And then silence smacks right in there...
... And it is loud!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top