This documentation is archived and is not being maintained.

Inspectors.NewInspector Event

Office 2007
Occurs whenever a new inspector window is opened, either as a result of user action or through program code.



expression   A variable that represents an Inspectors object.


NameRequired/OptionalData TypeDescription
InspectorRequired[_INSPECTOR]The inspector that was opened.


This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

The event occurs after the new Inspector object is created but before the inspector window appears.


This Microsoft Visual Basic/Visual Basic for Applications (VBA) example displays the Standard and Formatting toolbars of an inspector when it is opened. The sample code must be placed in a class module, and the Initialize_handler routine must be called before the event procedure can be called by Microsoft Outlook.

Visual Basic for Applications
Public WithEvents myOlInspectors As Outlook.Inspectors

Public Sub Initialize_handler()
    Set myOlInspectors = Application.Inspectors
End Sub

Private Sub myOlInspectors_NewInspector(ByVal Inspector As outlook.Inspector)
    Inspector.CommandBars.Item("Standard").Visible = True
    Inspector.CommandBars.Item("Formatting").Visible = True
End Sub