private sub command1_click() ??? dim ielist as new shellwindows ??? dim browser ??? dim doc ??? ??? on error resume next ??? ??? '遍历当前地浏览器窗口 ??? for each browser in ielist ??????? '找到需要地ie窗口 ??????? if browser.document.title = "testpage" then ??????????? '获得浏览器地文档对象 ??????????? set doc = browser.document ??????????? ??????????? '填写用户名字段 ??????????? doc.body.all("loginname").value = "eddie" ??????????? '填写密码字段 ??????????? doc.body.all("loginpassword").value = "123456" ??????????? ??????????? '提交 ??????????? doc.body.all("clickme").click ??????? end if ??? next end sub