I have a global variable set at the top of the module:
I then have code within Sub AutoOpen() to do this immediately when the document is opened:
The contents of Admin.txt is:
The problem is that rather than reading the file line by line and putting this into the global variable it is deleting the contents. Any suggestions would be welcomed. Thanks...
Code:
Public GLBstrEFOLDERID As String
I then have code within Sub AutoOpen() to do this immediately when the document is opened:
Code:
Sub AutoOpen()
Dim strReadLine As String
If Dir("\\itax-dmdev2\SOAPDownload\Admin.txt") <> "" Then
Open "\\itax-dmdev2\SOAPDownload\Admin.txt" For Output As #1
Do While Not EOF(1)
Line Input #1, strReadLine
If Left(strReadLine, 9) = "EFOLDERID" Then
GLBstrEFOLDERID = Mid(strReadLine, 11, 31)
End If
Loop
Close #1
End If
MsgBox GLBstrEFOLDERID
End Sub
The contents of Admin.txt is:
Code:
EFOLDERID=0000000000000000000000000935691
The problem is that rather than reading the file line by line and putting this into the global variable it is deleting the contents. Any suggestions would be welcomed. Thanks...