可用FSO,速度绝对要快,先用以下代码读你的文件到内存中再处理 Option Explicit
Private objFileSystem As New FileSystemObjectPrivate TreeItems() As TreeData' Type declaration for tracking
Private Type TreeData
    Caption As String
    Key As String
    Parent As String
    URL As String
    Frame As String
    Folder As Boolean
    NodeIndex As Long
End TypePublic Sub LoadTreeArray(ByVal pstrFileName As String)Dim objText As TextStream
Dim strData As String
Dim i As Integer' Check to see if the file exists
If Not objFileSystem.FileExists(pstrFileName) Then
    Err.Raise vbObjectError+6001, "LoadTree", "File does not exist"
    Exit Sub
End If' Open the text file for reading
Set objText = objFileSystem.OpenTextFile(pstrFileName, _
    ForReading, False, TristateFalse)' Clear the array
Erase TreeItems'Load the array of structures
Do While Not objText.AtEndOfStream
    On Error GoTo ReDimErr
    ReDim Preserve TreeItems(UBound(TreeItems) + 1)    On Error GoTo LoadArrayErr
    i = UBound(TreeItems)
    strData = objText.ReadLine    With TreeItems(i)
      .Caption = ParseTreeData(strData)
      .Key = ParseTreeData(strData)
      .Parent = ParseTreeData(strData)
      .URL = ParseTreeData(strData)
      .Frame = ParseTreeData(strData)
      .Folder = ParseTreeData(strData)
    End With
LoopobjText.Close
Set objText = NothingExit Sub
ReDimErr:
    ReDim TreeItems(0)
    Resume Next
    Exit SubLoadArrayErr:
    Err.Raise vbObjectError+6002, "LoadTreeArray", Err.DescriptionEnd SubPrivate Function ParseTreeData(pstrData As String)' This function chops off the next value and returns
' it through the function
Dim strWorking As String' If there is no delimiter assume the rest of the string is it
If InStr(1, pstrData, ",") = 0 Then
    strWorking = pstrData
    pstrData = vbNullString
Else
    strWorking = Mid(pstrData, 1, InStr(1, pstrData, ",") - 1)
    pstrData = Mid(pstrData, InStr(1, pstrData, ",") + 1)
End IfParseTreeData = strWorkingEnd Function