Automation call fails on WebBrowser embedded in MS Forms Framecontrol

T

tomas

Insert MS Forms 2.0 Frame control into Word document.
Right-click on it, pick "Frame Object->Edit".
Toolbox dialog with insertable controls should appear, if not, right-
click on the form obejct and check "Toolbox..." from context menu.
Right-click on the toolbox and pick "Additional controls...", find
Microsoft Web Browser. Insert it on the form.

Add a button into the document and put following code to handler
function:

Private Sub CommandButton1_Click()

Me.Frame1.Controls.Item("WebBrowser1").Object.Navigate2
"www.google.com"

End Sub

VBA will return Runtime error 80004005 (E_FAIL). The same for any
other call on any interface of the browser control.

Does anyone know if it should even work or if I'm doing something
wrong?

Thanks,
Tomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top