Option Explicit
Private Sub Form_Load()
'需要引用Microsoft Internet Controls对象
Dim WebCount As SHDocVw.ShellWindows
Dim tmpI As Long, tmpWeb As WebBrowser
Set WebCount = New SHDocVw.ShellWindows
MsgBox "已经打开" & WebCount.Count & "个网页"
For tmpI = 0 To WebCount.Count - 1
Set tmpWeb = WebCount.Item(tmpI)
Debug.Print tmpWeb.LocationURL
Debug.Print tmpWeb.LocationName
Next
Set tmpWeb = Nothing
End Sub
评论