這應該讓你關閉
MyPath = "path to folder containing HTML files"
Set fso = CreateObject("Scripting.FileSystemObject")
Set my_files = fso.getfolder(MyPath).Files
For Each f1 In my_files
Set TxtStream = fso.OpenTextFile(path_fname, ForReading, False, TristateUseDefault)
my_var = ""
Do While Not TxtStream.AtEndOfStream
my_var = my_var & TxtStream.ReadLine
Loop
TxtStream.Close
pos_1 = instr(1, my_var, "your Title")
pos_2 = instr(pos_1, my_var, " ")
my_txt = mid(my_var, pos_1, pos_2 - pos_1)
' do whatever with the captured text
Next
來源
2014-03-06 14:25:20
ron
感謝羅恩,我會給一個鏡頭! – 114
我似乎有一個讓我的循環執行的問題,你有一個循環的例子可以運行大約2000個文件嗎? – 114
您的所有HTML文檔是否位於一個文件夾中,並且它們是該文件夾中的唯一文件? – ron