11-19-2009, 04:58 AM
following script should solve your problem
Code:
Option Explicit
Dim oTxtFile, oFTO,sCharacters,cTextFile,i,nametofind,name
'Creating an object
Set oFTO = CreateObject("Scripting.FileSystemObject")
Set oTxtFile = oFTO.OpenTextFile("C:\test.xml", 1)
nametofind = Split ( oTxtFile.ReadAll , "name =", -1)
For i=1 To UBound(nametofind)
name = name & vbNewLine & Mid ( nametofind(i),2,12)
Next
'disaplaying the captured names
MsgBox name
'create a txt file
Set cTextFile=oFTO.createtextfile( "C:\test.txt",true)
'writing the names captured to the text file
cTextFile.writeline name