title: Optical zoom in webbrowser control
body: <p>I successfully use webbrowser control from VB.NET to show and print documents but I can't get zoom functionality which I would like to apply.</p>
  
  <p>For example you can create a new project, add a form with "Webbrowser1" control and two buttons "btn_Plus" and "btn_Minus".<br>
  Don't forget to add COM reference to "Microsoft Internet Controls".</p>
  
  <pre><code>Option Strict Off 'because of late binding MyWeb.ExecWB
  Imports SHDocVw
  
  Public Class Form1
  Dim zoomvalue As Integer = 50
  
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
      Dim strHtml As String = "&lt;HTML&gt;&lt;h1&gt;Doc...&lt;h1&gt;&lt;/br&gt;&lt;h4&gt;My html here&lt;/br&gt;acts like web page.&lt;h4&gt;&lt;/HTML&gt;"
      Me.WebBrowser1.Navigate("about:" + strHtml)
  End Sub
  
  Private Sub zoom()
      Try
          Dim MyWeb As Object = Me.WebBrowser1.ActiveXInstance
          MyWeb = Me.WebBrowser1.ActiveXInstance
          MyWeb.ExecWB(OLECMDID.OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, zoomvalue, IntPtr.Zero)
          MyWeb = Nothing
      Catch ex As Exception
          'MessageBox.Show("Error:" &amp; ex.Message)
      End Try
  End Sub
  
  Private Sub btn_Plus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Plus.Click
      zoomvalue += 5
      zoom()
  End Sub
  
  Private Sub btn_Minus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Minus.Click
      zoomvalue -= 5
      zoom()
  End Sub
  End Class
  </code></pre>
  
  <p>1) Why this won't work and I think it should work?<br>
  2) How to get this to work?<br>
  3) How to get current zoom value from actual webbrowser?  </p>