Search notes:

Outlook Object Model: Inspector

The inspector object represents the window in which an Outlook-item is displayed.

Methods and properties

activate() Brings the window to the foreground and gives it keyboard focues.
application
attachmentSelection
caption The title of the window
class Evaluates to an olObjectClass
close() Closes the window. Takes a required parameter of type olInspectorClose (olDiscard, olSave or olPromptForSave)
currentItem returns the item that is displayed in the inspector
display() use activate instead.
editorType Returns a member of the olEditorType enum (olEditorHTML, olEditorRTF, olEditorText or olEditorWord)
height
hideFormPage()
isWordMail() See also the wordEditor property.
left
modifiedFormPages
newFormRegion()
openFormRegion()
parent
saveFormRegion()
session
setControlItemProperty()
setCurrentFormPage()
setSchedulingStartTime()
showFormPage()
top
width
windowState olMaximized, olMinimized or olNormalWindow
wordEditor Only valid if isWordMail() returns true

Close displayed (open) eMail messages

option explicit

sub closeDisplayedEmailMessages() ' {

    dim ins as inspector
    for each ins in application.inspectors

        if ins.currentItem.class = olMail then
           ins.currentItem.close olDiscard
        end if

    next ins

end sub ' }
Github repository about-MS-Office-object-model, path: /Outlook/Inspector/close-displayed-eMail-messages.vb

See also

application.activeInspector

Index