NewInspector Event

Microsoft Outlook Visual Basic

Occurs whenever a new inspector window is opened, either as a result of user action or through program code. This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

Sub object_NewInspector(ByVal Inspector As Inspector)

object    An expression that evaluates to an Inspectors collection object.

Inspector    Required. The inspector that was opened.

Remarks

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

Example

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.

Dim myOlApp As New Outlook.Application
Public WithEvents myOlInspectors As Outlook.Inspectors

Public Sub Initialize_handler()
	Set myOlInspectors = myOlApp.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