Tim_Myth
09-06-2003, 05:38 PM
I'm using VB 6, and I have a form containing about 250 labels. The captions of the labels are updated as the data changes. I would like to write the caption of each label to a text file when the program is closed out and read them in again the next time the program is opened. I hoped this would be a simple task, but the following code does not work.
Private Sub form_unload(cancel As Integer)
Dim fs, a
Dim X As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\MyDomInfo.txt", True)
a.writeline ("This is a test.")
For Each Label In frmDomBrowser.Label1
a.writeline (frmDomBrowser(X).Caption)
Next
a.Close
MsgBox ("Done")
End Sub
Any suggestions? (For ease of programming, I named each label descriptively rather than sticking with teh standard Label1, Label2, Label3, etc. naming. Doh!)
Private Sub form_unload(cancel As Integer)
Dim fs, a
Dim X As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\MyDomInfo.txt", True)
a.writeline ("This is a test.")
For Each Label In frmDomBrowser.Label1
a.writeline (frmDomBrowser(X).Caption)
Next
a.Close
MsgBox ("Done")
End Sub
Any suggestions? (For ease of programming, I named each label descriptively rather than sticking with teh standard Label1, Label2, Label3, etc. naming. Doh!)