Menus not displaying in Web Browser control

P

Phil Hazell

Hi

I am using VB.NET to automate a Visio application. When I use the web browser control to load a Visio drawing, the menus and toolbars do not show. When I open any other Office documents, the menus merge as expected

I am using the following code from the msdn web site

Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object,
ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event)
Handles AxWebBrowser1.NavigateComplete

On Error Resume Nex

oDocument = e.pDisp.Documen

'Note: You can use the reference to the document object t
' automate the document server
MsgBox("File opened by: " & oDocument.Application.Name
' AxWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER

End Su

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Clic
' Show floating toolba
With oDocument.Application.CommandBars("formatting"
.Position = 4 '[msoBarFloating
.Visible = Tru
End Wit

End Su

Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Clic
' Merge menus
On Error Resume Nex
AxWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER
End Sub
 

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