How to show zoomed out web browser in vb6.0
vb6
Solution
This only works once a document has loaded, then seems to persist for subsequent navigation.
If you attempt to change the optical zoom when there is no DOM document, error 80040100 occurs.
The code below simply sets zoom initially at the appropriate time;
Private Const OLECMDID_OPTICAL_ZOOM As Long = 63
Private Const OLECMDEXECOPT_DONTPROMPTUSER As Long = 2
Private mblHasSetZoom As Boolean
Private Sub Form_Load()
web1.Navigate2 "http://www.google.com"
End Sub
Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not mblHasSetZoom Then
web1.ExecWB OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, 35&
mblHasSetZoom = True
End If
End Sub
Problem
This is the code am using for zoomed out web browser ``` Const OLECMDID_OPTICAL_ZOOM = 63 Const OLECMDEXECOPT_DONTPROMPTUSER = 2 Web1.ExecWB OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, CLng(35), vbNull ``` when i use the code i get the following runtime error: -2147221248 (80040100): Automation Error Any ideas? Edited: I use the code given by you. It works fine in debug mode once i take exe and run it shows the following error.