This is a procedure that I use to take information on a form and write it to a text file.
First add a commondialog control to your form.
Private Sub Write_ToFile()
'// Writes the registration information to a file.
Dim l_strFileToSave As String
CommonDialog1.fileName = App.Path & LoadResString(155)
CommonDialog1.filter = "Text (*.txt)|*.txt|WordPad (*.wpd)|*.wpd" 'dialog box filter
CommonDialog1.ShowSave
l_strFileToSave = CommonDialog1.fileName
If l_strFileToSave = "" Then Exit Sub
Open l_strFileToSave For Output Access Write As #1
Print #1, vbCrLf & vbCrLf
Print #1, vbTab & vbTab & LoadResString(150) & " " & LoadResString(11) & vbCrLf & vbCrLf & vbCrLf
Print #1, "Registration Form" & vbCrLf
Print #1, "Fax to: " & LoadResString(153) & LoadResString(154) & vbCrLf
Print #1, "Date: " & Date
Print #1, "Product: " & txtProduct.Text
Print #1, "Version: " & App.Major & "." & App.Minor & "." & App.Revision
Print #1, "Serial Number: " & txtSerialNumber.Text & vbCrLf
Print #1, "Company: " & txtCompany.Text
Print #1, "Name: " & txtName.Text
Print #1, "Title: " & txtTitle.Text
Print #1, "Address 1: " & txtAddress1.Text
Print #1, "Address 2: " & txtAddress2.Text
Print #1, "City / Town: " & txtCity.Text
Print #1, "Province / State: " & cboProvSt.Text
Print #1, "Country: " & cboCountry.Text
Print #1, "Postal / Zip Code: " & txtPCZip.Text
Print #1, "Phone Number: " & mebPhone.Text
Print #1, "Fax Number: " & mebFax.Text
Print #1, "E-Mail Address: " & txtEmail.Text & vbCrLf
Print #1, "Comments: " & txtComments.Text
Close #1
End Sub
Thanks and Good Luck!
zemp