Jump to content

How to insert this code into Html page ?


vmars316

Recommended Posts

Hello & Thanks ,

I would like to convert .html to .rtf and/or .txt format .

I found the following code @

stackoverflow.com/questions/150208/how-do-i-convert-html-to-rtf-rich-text-in-net-without-paying-for-a-component

that converts html to rtf .

I would like to insert code below , into an html page .

Pls , what would the html/javascript (that wraps code) look like ?

Using reportWebBrowser As New WebBrowser        reportWebBrowser.CreateControl()        reportWebBrowser.DocumentText = sbHTMLDoc.ToString        While reportWebBrowser.DocumentText <> sbHTMLDoc.ToString            Application.DoEvents()        End While        reportWebBrowser.Document.ExecCommand("SelectAll", False, Nothing)        reportWebBrowser.Document.ExecCommand("Copy", False, Nothing)        Using reportRichTextBox As New RichTextBox            reportRichTextBox.Paste()            reportRichTextBox.SaveFile(DocumentFileName)        End Using    End Using

Thanks...Vern

Link to comment
Share on other sites

A .txt file would imply plain text with no formatting.

 

If this is just a one-time task I would simply look at the rendered text in a browser and then copy and paste the text into MSWord or Open Office Writer, where you could then use the formatting features to make it look like the original page (save as .rtf).

 

If you plan to do this for multiple pages then you might want to first create a template page to paste the text into.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...