If you can read the whole file into a string, you can use this method to look for all the strings included between two tokens. This method just prints them out, you have to decide what to do with them. This is a snippet of the code I use.
Marco
Private Sub FindTokens(s As String, sStart As String, sEnd As String)
Dim k1 As Long
Dim k2 As Long
Dim kin As Long
kin = 1
Do
k1 = InStr(kin, s, sStart, vbTextCompare)
If k1 <= 0 Then Exit Sub
k1 = k1 + Len(sStart)
k2 = InStr(k1, s, sEnd, vbTextCompare)
If k2 <= 0 Then Exit Sub
Debug.Print Mid$(s, k1, k2 - k1) '' or put them in an array or something
kin = k2 + Len(sStart)
Loop
End Sub
|