使用 VBA,我可以使用以下命令创建具有 3 个不同选项卡的 InternetExplorer 对象
Option Explicit
Public Enum IE_READYSTATE
Uninitialised = 0
Loading = 1
Loaded = 2
Interactive = 3
complete = 4
End Enum
Sub Example_Click()
Dim ieApp As clsIE
'Create IE and login
If ieApp Is Nothing Then
Set ieApp = New clsIE
With ieApp
'IE Tab1
.IE.Visible = True
.IE.navigate "http://www.bbc.co.uk/news/"
Do While .IE.Busy Or Not .IE.readyState = IE_READYSTATE.complete: DoEvents: Loop
'IE Tab2
.IE.Navigate2 "http://www.bbc.co.uk", CLng(2048)
Do While .IE.Busy Or Not .IE.readyState = IE_READYSTATE.complete: DoEvents: Loop
'IE Tab3
.IE.Navigate2 "http://www.bbc.co.uk", CLng(2048)
Do While .IE.Busy Or Not .IE.readyState = IE_READYSTATE.complete: DoEvents: Loop
End With
End If
End Sub
然后我怎样才能访问这些选项卡以......
- 退出/关闭特定选项卡?
- 导航到特定选项卡上的新 URL?
- 访问特定的选项卡 DOM?
我知道如何使用单个选项卡而不是多个选项卡来完成所有这些操作?