473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

convert plain text to rich text

' hi all

' suppose i have this:
Dim strText As String = "Hello! <b>this</b> text <i>is</i> formatted"
' NOTE: i want the "this" to be bold and the "is" italic

' but when i do this:
Me.RichTextBox1.TextRTF = strText
' the the richtextbox shows a string exactly as typed above instead of
actually applying the formatting.

what am I doing wrong?
does anyone know if it's possible to get the results i'm expecting?

thx,
Zacho
Oct 6 '05 #1
1 2905
Zachovich wrote:
' suppose i have this:
Dim strText As String = "Hello! <b>this</b> text <i>is</i> formatted"
' NOTE: i want the "this" to be bold and the "is" italic

' but when i do this:
Me.RichTextBox1.TextRTF = strText
' the the richtextbox shows a string exactly as typed above instead of
actually applying the formatting.

what am I doing wrong?
The string you are using has HTML tags. The richtext editor doesn't have a
clue what to do with those. RTF is a completely different format from HTML.
does anyone know if it's possible to get the results i'm expecting?


Assuming you have HTML content and need to transfer the formatting to RTF,
not easily. Of course it would be possible to convert the one into the
other, I guess - as long as the various formatting options are supported
in both worlds. Here's an RTF spec:
http://www.biblioscape.com/rtf15_spec.htm

Depending on what you want to do, a much more useful idea might be to use
an IE ActiveX control instead of the RichTextBox and just display the HTML
code as it is.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
Oct 7 '05 #2

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

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
1
by: rob.kellington at gmail | last post by:
Does anyone have the logic to convert RTF formatted data in a text column into plain ascii text that I can use in a varchar variable or field? We have an app that allows formatted comments/notes...
4
by: Ted | last post by:
I have a SQL Server 2000 table with a few fields of "text" data type that contain rich text. I have to downstream this data and the recipient cannot handle rich text. I need to figure out a way...
2
by: Andrew Stewart | last post by:
Hi, does anybody know where to get a component that converts Rich Text to Plain Text? TIA Andrew
3
by: Rich Wallace | last post by:
Hi all, I'm writing a simple SQL Server DTS management VB.NET web app for our first level support group. I'm adding in the capability to execute a package but I was curious if there was a way to...
1
by: Zachovich | last post by:
' hi all ' suppose i have this: Dim strText As String = "Hello! <b>this</b> text <i>is</i> formatted" ' NOTE: i want the "this" to be bold and the "is" italic ' but when i do this:...
4
by: Rich | last post by:
Hello txtID.Text contains a 6 digit Integer number with no decimals, no chars... Dim j As Integer = Cint(txtID.Text) or Dim j As Integer = Convert.ToInt32(txtID.Text)
4
by: csgraham74 | last post by:
Hi, Ive posted on this previously but had no response. Basically i need to build some html using a rich text editor. Then i want to actually create an html document from this and save it to my...
6
by: Justin | last post by:
Hi all, i need some help over here... i found the solution to export file from mysql db into *.csv. but is there anyway to convert the contents into *.doc and save in my webserver and providing a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.