Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Documents Outlook 2007

I was wondering if there is any way to read informations out from a text file with VBA in Outlook 2007.

Thanks for attention

like image 619
VanDeath Avatar asked Mar 29 '26 17:03

VanDeath


1 Answers

  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.

like image 107
Jacob Avatar answered Apr 01 '26 06:04

Jacob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!