Solved

Convert HTML to text IN VB.Net.

Posted on 2014-01-20
2
858 Views
Last Modified: 2014-01-21
Hi Guys

I need to convert HTML TO TEXT.

Below is an example of HTML.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE><!-- p { margin-top: 0em; margin-bottom: 0em; font-family:"","serif"; } --></STYLE>

<META name=GENERATOR content="MSHTML 10.00.9200.16750"></HEAD>
<BODY>
<P>Hi there</P>
<P>&nbsp;</P>
<P>Why does this have to be so complicated.</P>
<P>&nbsp;</P>
<P>Cheers</P>
<P>Shezad</P>
<P>&nbsp;</P>
<P>&nbsp;</P></BODY></HTML>
0
Comment
Question by:Shezad Ahmed
2 Comments
 
LVL 39

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39794658
From:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/ba388d58-6a6c-4039-ac2d-c7ef0ab721fe/html-content-convert-to-text?forum=wcf

It looks like you can use the html agility pack (http://htmlagilitypack.codeplex.com/):

Dim plainText as String = ConvertToPlainText(MyhtmlString)
0
 

Author Closing Comment

by:Shezad Ahmed
ID: 39796663
Thanks,

It worked a treat.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now