|
'最大化IE浏览器
Sub MaximizeBrowser1
Set BrowserObject = Description.Create()
BrowserObject("NativeClass").Value = "IEFrame"
Set WindowsBrowser = Desktop.ChildObjects(BrowserObject)
brNum = WindowsBrowser.Count - 1 msgbox("browserNum:"&brNum)
For i = 0 To brNum
ieVersion = WindowsBrowser(i).GetROProperty("Application")
msgbox("ieVersion:"&ieVersion)
wndTitle = WindowsBrowser(i).GetROProperty("title")
msgbox("windowTitle:"&wndTitle)
Set ObjectBrowser = Browser("micclass:=Browser", "index:="&i)
If Instr(ieVersion,6) > 0 Then
Window("regexpwndclass:=IEFrame","index:=0","text:="&wndTitle&".*").Maximize
Else
WindowsBrowser(i).Maximize
End If
Next
Set ObjectBrowser = Nothing
Set WindowsBrowser = Nothing
Set BrowserObject = Nothing
End Sub
上面的库函数是先遍历已经打开的IE,然后最大化IE.
只是想问下为什么用
ieVersion = WindowsBrowser(i).GetROProperty("Application")
msgbox("ieVersion:"&ieVersion)
取不到IE版本号? |
|