Easy way to reading any flat/text file it take only few line of code
Easy way to reading any flat/text file it take only few line of code
API Declarations
Dim MailContents As String
Dim filecontents
Dim datafile$
Dim NextAvailFreefile%
Dim ctr
Rate Easy way to reading any flat/text file it take only few line of code
(2(2 Vote))
'****************************************
'Declareing the Variables
'****************************************
Dim temp
Dim MailContents As String
Dim filecontents
Dim datafile$
Dim NextAvailFreefile%
Dim ctr
'*****************************************
filepath = App.Path 'assign the File Path
NextAvailFreefile = 0 'Setting the variable
NextAvailFreefile = FreeFile
datafile = filepath 'assigning the file name to a variable
Open datafile For Input As #NextAvailFreefile 'opening the File
Do While Not EOF(NextAvailFreefile)
DoEvents
Line Input #NextAvailFreefile, filecontents
temp = Trim(Left(filecontents, 3)) 'Reading the file contants
Loop
Close NextAvailFreefile
End Sub
Easy way to reading any flat/text file it take only few line of code Comments
No comments yet — be the first to post one!
Post a Comment