Click here to Skip to main content
6,306,412 members and growing! (17,072 online)
Email Password   helpLost your password?
Languages » VB.NET » Utilities     Intermediate

Using a VB.NET 2005 Class to Convert RichText to HTML

By George H. Slaterpryce III

A quick way to convert RichText to HTML.
VB, HTML, Windows, .NET, ASP.NET, VS2005, Dev
Posted:2 Nov 2006
Views:37,173
Bookmarked:49 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
11 votes for this article.
Popularity: 3.89 Rating: 3.73 out of 5
2 votes, 18.2%
1

2
1 vote, 9.1%
3
2 votes, 18.2%
4
6 votes, 54.5%
5

A window showing a Rich Editor and the resutling HTML code

Introduction

This code was written to solve the problem of having RichText data needing to be displayed in HTML, both in HTML reports and in ASP.NET web pages.

Using the code

Use of the code is exceptionally simple. Simply create a new instance of the class and then use the properties to first pass in the RichText to parse and then use the html property to get the resulting HTML. (The code file for the class is attached to this article).

''Assume you have a RichTextBox on your 

''form named rtbFoo and a button named btnBar


  Private Sub btnBar_Click(ByVal sender as object, _
          e as System.EventArgs) Handles btnBar.Click
    dim r2h as new RTFtoHTML
    r2h.rtf = rtbFoo.rtf
    messagebox.show(r2h.html)
  End Sub

History

  • Initial release - 11/02/2006.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

George H. Slaterpryce III


Member
George is a full time software developer and owner employed by Captovis Advanced Industries and part owner of Bridges Software Group (A software company that writes software for the medical industry).

He has been programming since 1995, starting out with Borland Turbo C++ 3 and eventually learning several different languages such as
Pascal/Delphi,Basic,ASM,Visual Basic,FoxPro, ASP, PHP, and Perl.

George's current language of choice is VB.NET 2005.


Occupation: Web Developer
Location: United States United States

Other popular VB.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 17 of 17 (Total in Forum: 17) (Refresh)FirstPrevNext
GeneralBugs Pinmemberhristo14222:55 20 Apr '09  
GeneralRe: Bugs PinmemberSorwen7:59 30 Apr '09  
GeneralRe: Bugs Pinmemberjoseph_man5:02 6 May '09  
GeneralRe: Bugs PinmemberSorwen18:03 5 Jun '09  
Generalhi Pinmembermwau0:01 26 Feb '09  
GeneralNot saving any image Pinmembersuis7:40 11 Feb '09  
GeneralHey.. good one .. PinmemberAbhishek sur23:00 27 Aug '08  
Generalsaving the converted file Pinmemberquioske4:57 9 May '08  
GeneralNice PinmemberGlimmerMan4:09 6 Aug '07  
Generalescape characters Pinmembergary711:52 3 Aug '07  
GeneralUnderline Pinmemberfrederic.robert6:02 29 May '07  
GeneralRe: Underline PinmemberGeorge H. Slaterpryce III14:29 18 Jul '07  
GeneralGreat work PinmemberKaushal Mca3:23 16 May '07  
GeneralBullets Pinmembercraver841:57 13 May '07  
Generalrtf2HTML - Example Source code PinmemberRajesh Moriyani2:59 2 Jan '07  
GeneralHTML word Pinmemberpablleaf8:21 3 Nov '06  
GeneralRe: HTML word PinmemberGeorge H. Slaterpryce III8:24 3 Nov '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 2 Nov 2006
Editor: Smitha Vijayan
Copyright 2006 by George H. Slaterpryce III
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project