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

StackOverflow https://stackoverflow.com//questions/9561142

  •  06-12-2019
  •  | 
  •  

Question

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");
Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top