'需要引用Microsoft Internet Controls对象
Dim Titles, LocalNames As String
Dim IEList As New SHDocVw.ShellWindows
Dim Doc
Dim I, ii, iii As Integer
Dim clName As String
Titles = "表单填写"
ii = IEList.Count
For I = 0 To ii - 1 '遍历当前浏览器窗口
LocalNames = Left(IEList.Item(I).LocationName, Len(Trim(Titles))) '找到需要的IE窗口
If LocalNames = Trim(Titles) Then '获得浏览器文档对象,填写表单
Set Doc = IEList.Item(I).Document