Dim oShellApp, oShellAppWindows, WebBrowser
Set oShellApp = CreateObject("Shell.Application")
Set oShellAppWindows = oShellApp.Windows
For Each WebBrowser In oShellAppWindows
MsgBox LCase(TypeName(WebBrowser.document))
If LCase(TypeName(WebBrowser.document)) = "htmldocument" Then
'请把下面这行修改为实际网址
If WebBrowser.LocationURL = "http://www.baidu.com/" Then
'下面开始自动填写表单,请根据实际进行修改::
WebBrowser.document.f.kw.Value = "weichao" '
'WebBrowser.document.frames(0).document.loginonform.submit
WebBrowser.document.f.submit
End If
End If
Next