Set FSO = CreateObject("Scripting.FileSystemObject") if FSO.FileExists(partion & "\All Folder in All Drive.txt") Then Dim arrTxtFile : arrTxtFile = ReadTxtToArray(partion & "\All Folder in All Drive.txt") Function ReadTxtToArray(strInputFilePath) 'F1 Const ForReading = 1 Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objFile : Set objFile = objFSO.OpenTextFile(strInputFilePath, ForReading) ReadTxtToArray = Split(objFile.ReadAll, VbCrLf) msgbox ReadTxtToArray objFile.Close
Posts: 2663
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Make sure you are defining what partion is and then try something like this if you are trying to see the values of your array. Possible shortfalls of using Split on a .ReadAll have been discussed in other posts so you may want to search/look for those. i.e. http://www.visualbasicscript.com/m_47020/tm.htm