Creating a Custom Browser with Limited Functionality
Suppose you want to create a custom browser application to start and display an HTML page that is not the user's home or start page. You also want the custom browser to navigate only to HTML pages on the local domain or view files on the local hard disk. Here's how you could create this simple application: Use the Navigate2 method to go to the desired HTML page during form loading. 
Private Sub Form_Load()
On Error Resume Next 'Don't stop execution, continue on next line
WebBrowser.Navigate2 "http:\\www.xyzcorp.com"
If Err.Number <> 0 Then MsgBox "Error :" & Err.Description 'Display error message
End SubCheck the URL in the BeforeNavigate2 event to make sure the location string contains the local domain or disk. If the location string doesn't meet the criteria, cancel the operation and display an error message to the user. 
Private Sub WebBrowser_BeforeNavigate2(ByVal URL As String, ByVal Flags As Long, 
        ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, 
        Cancel As Boolean)
    If (Instr(1,URL,"xyzcorp.com") = 0) And (Instr(1,URL,"C:") = 0) Then
        Cancel = True
        MsgBox "Access denied to URL: " & URL
    End If
End SubPrinting the Current Page with the WebBrowser Control
The WebBrowser control supports several common file operations—such as Print, Print Preview, Save, Save As, New, and Properties—with the QueryStatusWB and ExecWB methods. These methods directly access theIOleCommandTarget interface for issuing commands on the Active Document or inquiring about which commands it supports. The following example shows the implementation of a Print command button that, when clicked, checks to make sure the Print command is valid and then displays the print dialog box for the WebBrowser control. Private Sub BtnPrint_Click()
Dim eQuery As OLECMDF       'return value type for QueryStatusWB On Error Resume Next
eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)  'get print command status
If Err.Number = 0 Then
     If eQuery And OLECMDF_ENABLED Then
         WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""    'Ok to Print?
  Else
         MsgBox "The Print command is currently disabled."
     End If
End If
If Err.Number <> 0 Then MsgBox "Print command Error: " & Err.Description
End Sub