Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-02-2020, 08:33 PM
gmayor's Avatar
gmayor gmayor is offline Is it possible to use a .txt file to populate a msgbox prompt field Windows 10 Is it possible to use a .txt file to populate a msgbox prompt field Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
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 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Make 2013 Populate To Field abraxis Outlook 2 08-10-2018 06:41 AM
populate list with unique field value on repeated field value sukusnairss Excel 1 04-03-2018 11:47 PM
Have Text Entered in Content Control / PreDefined Field Populate Field in Footer bzowk Word 1 04-14-2016 11:50 AM
Is it possible to use a .txt file to populate a msgbox prompt field Prompt a macro to run when opening a specific file type gmanword Word VBA 5 11-30-2013 02:55 PM
Openin File in Use Locks PC Up, No Read only Prompt barkster Office 0 06-08-2010 01:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft