Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("HTMLfile.txt", 1, True) Do While f.AtEndOfLine <> True SearchString =a.readline 'you can also use readAll ..depends upon the requirement SearchChar = "Keyword" MyPos = Instr(1, SearchString, SearchChar) 'so you will get the location of you string you may use String functions like LEFT/RIGHT/MID to get what you want