path = "E:\文件"
Set fso = CreateObject("Scripting.FileSystemObject")
For Each x In fso.GetFolder(path).Files '遍历指定文件夹里的所有文件
word = Split(x.OpenAsTextStream.ReadAll,vbCrLf) '以换行分割成数组
word(15) = "Ws.SendKeys """ & fso.GetBaseName(x.Name) & """" '对第16行重写
x.OpenAsTextStream(2).Write Join(word,vbCrLf) '重新写入原文件
Next