I was wondering if there is any way to read informations out from a text file with VBA in Outlook 2007.
Thanks for attention
Private Sub Command1_Click()
'Declare variables.
Dim fso As New FileSystemObject
Dim ts As TextStream
'Open file.
Set ts = fso.OpenTextFile(Environ("windir") & "\system.ini")
'Loop while not at the end of the file.
Do While Not ts.AtEndOfStream
Debug.Print ts.ReadLine
Loop
'Close the file.
ts.Close
End Sub
From MSDN FSO Object
Way more comfortable then Open sPath, #FileNo. You need to add FSO to your project with "Tools -> References", like it's described in the MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With