Option Explicit

Const ForReading = 1
Const ForWriting = 2
Dim oFileSystemObject 'As FileSystemObject
Dim oTextStream 'As TextStream
Dim sKeywords 'As String
Dim sStatements 'As String

Dim sPath 'As String

Set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
sPath = "C:\temp\" 'location of downloaded XML files
sPath = "C:\Igor\DL\softcom\vb\cached\"
Dim s 'As String
Dim i 'As Integer

Set oTextStream = oFileSystemObject.OpenTextFile(sPath & "office975387_.xml", ForReading, False)
While Not oTextStream.AtEndOfStream
  s = oTextStream.ReadLine
  i = InStr(LCase(s), "href")
  If i > 0 Then
    s = Left(s, i - 1)
    s = Mid(s, InStrRev(s, "=") + 1)
    s = Replace(s, " Operator" & Chr(34), "")
    s = Replace(s, " Directive" & Chr(34), "")
    s = Replace(s, " Function" & Chr(34), "")
    s = Replace(s, " Method" & Chr(34), "")
    s = Replace(s, " Statement" & Chr(34), "")
    s = Replace(s, " Data Type" & Chr(34), "")
    s = Replace(s, " Object" & Chr(34), "")
    s = Replace(s, " Statement" & Chr(34), "")
    s = Replace(s, " Event" & Chr(34), "")
    s = Trim(Replace(s, Chr(34), ""))
    sKeywords = sKeywords & s & vbCrLf
  End If
Wend
oTextStream.Close

Set oTextStream = oFileSystemObject.OpenTextFile("VBA.txt", ForWriting, True)
oTextStream.Write sKeywords 'save keyword list to a file
oTextStream.Close
Set oTextStream = Nothing
Set oFileSystemObject = Nothing

