• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2119
  • Last Modified:

VB.net Save contents of RichTextBox to html file

Hi

I found the following code to save the contents of a RichTextBox to a .rtf file.
Is there similar code out there to save the contents of a RichTextBox to an html file?

    Public Sub SaveMyFile()

        Dim saveFile1 As New SaveFileDialog()

        saveFile1.DefaultExt = "*.rtf"
        saveFile1.Filter = "RTF Files|*.rtf"

        If (saveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
            And (saveFile1.FileName.Length) > 0 Then

            Me.Label1.Text = saveFile1.FileName

            RichTextBox1.SaveFile(saveFile1.FileName, _
                RichTextBoxStreamType.PlainText)
        End If
    End Sub
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Great answer. Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now