我周围已经找不到ie6了............
贴第一个的代码吧,我在ie9和ie10上面试了可以,第二个没有具体的网页也没法写了- For Each w In CreateObject("Shell.Application").Windows
- If TypeName(w.document) = "HTMLDocument" Then
- s = w.document.selection.createRange().text
- If Not s = "" Then
- CreateObject("Scripting.FileSystemObject") _
- .CreateTextFile("C:\log.txt", True) _
- .Write s
- Exit For
- End If
- End If
- Next
复制代码
|