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

VB.net Save contents of RichTextBox to html file


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, _
        End If
    End Sub
Murray Brown
Murray Brown
1 Solution
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Great answer. Thanks

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