Set ie=createobject("internetexplorer.application") ie.navigate "about:blank" ie.visible=False
set fso=createobject("scripting.filesystemobject") set f=fso.opentextfile("c:\\新建文档.txt",2,true)
while true str=ie.document.parentwindow.clipboarddata.getdata("text") if str<>"" then f.Write vbCrLf&str ie.document.parentwindow.clipboarddata.setdata "text","" End If
Sub Application_VBAStart() Set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate("about:blank") objIE.Visible = False call Application.SetTimer(1,5*60*1000) End Sub
Sub Application_Start() End Sub
Sub Application_End() objIE.Quit End Sub
Sub Application_Timer(ID) objIE.document.parentwindow.clipboardData.SetData "text", "Test" End Sub