How to open a browser window through Word using VBA with set height, width, and no menu bar

吃可爱长大的小学妹 提交于 2019-12-08 05:40:26

问题


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");

回答1:


How about something like:

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


来源:https://stackoverflow.com/questions/9561142/how-to-open-a-browser-window-through-word-using-vba-with-set-height-width-and

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!