如何使用设置了高度、宽度且没有菜单栏的 VBA 通过 Word 打开浏览器窗口 [英] How to open a browser window through Word using VBA with set height, width, and no menu bar
本文介绍了如何使用设置了高度、宽度且没有菜单栏的 VBA 通过 Word 打开浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我基本上想使用与 javascipt 相同的 VBA 从 Word 打开浏览器窗口:
I basically want to open a browser window from Word using VBA that does the same as javascipt:
window.open ("http://www.google.com","mywindow","menubar=0,resizable=0,width=350,height=250");
推荐答案
怎么样:
Sub window_Open(strLocation As String, Menubar As Boolean, height As Long, width As Long, resizable As Boolean)
With CreateObject("InternetExplorer.Application")
.Visible = False
.height = height
.width = width
.Menubar = Menubar
.Visible = True
.resizable = resizable
.Navigate strLocation
End With
End Sub
Sub test()
window_Open "www.google.com", True, 250, 350, False
End Sub
这篇关于如何使用设置了高度、宽度且没有菜单栏的 VBA 通过 Word 打开浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文