Monday, 8 November 2021
How to save richtextbox data to a text file in visual basic | Export dat...
How to save richtextbox data to a text file in visual basic | Export data to a text file or RTF file | How to save richtextbox content to a file in visual basic |Visual Basic 6 Step by Step Tutorial
In the Part:1, we have demonstrated "How to Load data from a text file (RTF) to Richtextbox using Common Dialog Control and Richtextbox Control
in Visual Basic" and How to Clear Rich Text Box Control.
In Part:2, we have discussed about "How to save Richtextbox data to a Text File or RTF file".
All steps are explained in detail,no step is skipped while making this video tutorial.
Step by Step Tutorial
Code
Dim data As String
Dim check As Integer
Dim filename As String
Private Sub Command1_Click()
opendialog.Filter = "Text Files (*.txt)|*.txt|RTf Files (*.rtf)|*.rtf|"
opendialog.ShowOpen
data = opendialog.filename
''check = Len(data)
If opendialog.filename = "" Then
MsgBox "You click on Cancel!! Kindly Select the file you want to load", vbOKOnly + vbCritical
Else
RichTextBox1.LoadFile (data)
End If
End Sub
Private Sub findbtn_Click()
opendialog.Filter = "Text Files (*.txt)|*.txt|RTf Files (*.rtf)|*.rtf|"
opendialog.ShowSave
filename = opendialog.filename
RichTextBox1.SaveFile filename, rtfText
End Sub
Subscribe to:
Post Comments (Atom)
ReplyDeleteYour Blog is very nice.Wish to see much more like this. Thanks for sharing your information.
First Aid Certification Highland