我要尋找一個解決以下VB批量.html文件/ URL。我想保存要在Microsoft Word中打開的.html文件。的VBScript批量HTML轉換爲Word
這是我一起工作的代碼,但我需要它爲多個.html文件工作:
Option Explicit
'Just change these two lines
Const HTMLFileIn="http://www.example.com"
Const DocFileOut="H:\Word"
Dim MyWord,oIE
Set MyWord=CreateObject("Word.Document")
Set oIE=CreateObject("InternetExplorer.Application")
oIE.Navigate HTMLFileIn
Attend
oIE.document.body.createTextRange.execCommand("Copy")
Attend
MyWord.Content.Paste
MyWord.SaveAs DocFileOut
MyWord.Close
oIE.Quit
Set oIE=Nothing
Set MyWord=Nothing
MsgBox HTMLFileIn & " is now saved as " & DocFileOut
Sub Attend
Wscript.Sleep 500
While oIE.busy
Wscript.Sleep 1000
Wend
While oIE.Document.readyState <> "complete"
Wscript.Sleep 1000
Wend
End Sub
在哪裏存儲的聯繫?代碼將如何決定如何命名新的單詞文件? – 2012-08-13 15:43:33
鏈接來自我的網站,我有一個1000頁轉換成單詞,可以將輸入集中到一個文件而不是多個文件? – user1595805 2012-08-13 16:54:37
這是可以理解的,但鏈接保存在哪裏。代碼應該循環檢索這些鏈接...例如文本文件或文件文件?另外你打算如何命名新的單詞文件? – 2012-08-13 16:56:16