使用Visual Basic下载Internet Explorer

时间:2018-06-13 05:24:58

标签: vba internet-explorer-11

我有一个脚本,可以在Internet Explorer中打开一个URL,输入用户名和密码,然后单击“提交”。我无法通过默认的Internet Explorer打开/保存提示。这可能吗?

Call Main

Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "https://www.blahblahblah.com"
    Wait IE
    With IE.Document
        .getElementByID("ctrluser").value = "blahblahblah"
        .getElementByID("ctrlpass").value = "blahblahblah"        
        .getElementByID("frmSubmit").Click
    End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub

此外,您可以将默认下载位置更改为特定网络文件夹吗?

0 个答案:

没有答案