View Single Post
 
Old 04-02-2020, 08:33 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Maybe the following is more what you had in mind.

Code:
Dim TextFile As Integer
Dim FilePath As String
Dim FileContent As String
Dim FileNum As Integer
Dim DataLine As String

    'File Path of Text File
    FilePath = "E:\Zmani\Logging\202004011500__Tmp_61385499383529 09.py_.txt"
    

    FileNum = FreeFile()
    Open FilePath For Input As #FileNum

    While Not EOF(FileNum)
        Line Input #FileNum, DataLine
        FileContent = FileContent & DataLine & vbCr
    Wend
    FileContent = Left(FileContent, Len(FileContent) - 1)
    Close

    'Report Out Text File Contents
    MsgBox FileContent
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote