Hi all,
I am trying to use the Replace function (with FileSystemObject code) with a variable but it just sees adds the variable name and not the content.
NME is just a string "TestUserAccount00005"
But 'NME' appears in the written file not 'TestUserAccount00005'
Any ideas
I am trying to use the Replace function (with FileSystemObject code) with a variable but it just sees adds the variable name and not the content.
NME is just a string "TestUserAccount00005"
But 'NME' appears in the written file not 'TestUserAccount00005'
Any ideas
Code:
' Open the file and read
Set objFile = fs.OpenTextFile(f, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "TestUserAccount - 10-07-09 115823", NME)
Write the new file
Set objFile = fs.OpenTextFile(f, ForWriting)
objFile.WriteLine strNewText
objFile.Close