• I am trying to hide the menubars and toolbars that are (sometimes) displayes as soon as a new PDF file is opened via the webbrowser:

    ufPdfs.WebBrowser1.Navigate "about:blank"

    ufPdfs.WebBrowser1.Document.write "<HTML><Body><embed src=""" & txtBePa & """ width=""100%"" height=""100%"" /></Body></HTML>"

    I tried to do this in 'BeforeNavigate2', but that does not have the expected result.

    Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    With WebBrowser1
    .AddressBar = 0
    .FullScreen = True
    .MenuBar = False
    .TheaterMode = True
    .Toolbar = 0
    End With
    End Sub

    Does someone know how to get rid of these things?

  • Your post does not comply with our Forum RULES. Use code tags around code.

    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the </> icon at the top of your post window.

    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!