OutlookSpy Toolbar

OutlookSpy creates an additional ribbon in Outlook to provide quick access to the mostly used Outlook and Extended MAPI objects. If you are interested in other objects, they can easily be displayed by browsing their parent objects. Most objects displayed by OutlookSpy are delivered in context: just highlight an item you are interested in, then click on a toolbar button: you will get information for the currently selected item, folder, message store, etc.

1. Script Editor - opens a window where you can type and execute any VBScript or JavaScript code.

2. Outlook Object Model interfaces -  4 buttons are available: Outlook (root of the Outlook object model), Explorer (current Explorer object), Folder (currently selected folder) and Item (currently selected item(s)). From these 4 objects, you can browse to any other object in the Outlook object hierarchy or to Extended MAPI interfaces (for objects with MAPIOBJECT property).

3. Extended MAPI interfaces - browse Extended MAPI interfaces.


Script Editor

Script editor allows you to type and execute any VBScript or JavaScript code. 

Two global objects are always available to the script: Application and CDOSession (if CDO is installed).
Use BrowseObject(Obj) function to browse any IDispatch'able object (see below).

Outlook Object Model interfaces

All Outlook and CDO object model interfaces (in fact all IDispatch'able interfaces) can be browsed in a similar manner. You can examine the values of the properties live, if the objects exposes events interface, its log will be displayed, etc.

If an object you are interested in is not available on the OutlookSpy toolbar, you can always browse to it by starting from its parent object: e.g. if you need to access the first recipient of a currently selected message, click "Item" button on the OutlookSpy toolbar, select "Recipients" property, click "Browse" button. In a new window for the Recipients object, go to the "Functions" tab, select "Item" function, click call, enter 1. A new window will be open for that recipient. This is equivalent to MailItem.Recipients.Item(1). If you don't mind typing a little script, you can instead go the "Script" tab of the MailItem object, type BrowseObject(MailItem.Recipients.Item(1)) and click "Run" button.

Below is an example for a MailItem object.

Properties tab shows a tree view of the particular object properties. 

Properties that are in turn other objects can be browsed either directly in the tree view or in a similar window (if you want to call functions and/or trace that object events) by clicking "Browse" button or selecting "Browse in New Window" from a popup menu. 

Clicking "Help" button shows a help topic for the property (if Outlook VBA help file is installed).

 Functions tab displays a list of functions and array properties available for the object along with required parameters. Clicking "Call" invokes dialog box to set function parameters (if there are any). If function result is another object, a new window is open to browse it.
 Events tab shows a list of all available events for the object along with parameters to be passed to the event handlers. If no events are available, this tab is not present. Example above shows events for MailItem along with Event log resulting from reading, opening and closing an item in a separate inspector.
 Script tab allows to type and execute any VBScript or JavaScript code. Similar to the Script Editor, ThisOutlookSession and CDOSession (if CDO is installed) global objects are always available along with the object being browsed (MailItem in this example).

No debugging support is available so far (MsgBox() and BrowseObject() functions are the only means of debugging). If you think you'd benefit from having advanced debugging capabilities (breakpoints, variables watch, etc), please let me know.

Extended MAPI interfaces

OutlookSpy can browse and display relevant information for the following Extended MAPI interfaces: IMAPISession, IAddrBook, IDistList, IMailUser, IMsgStore, IMAPIFolder, IMessage, IAttach, IMAPITable, IMAPIStatus, IMAPIContainer, IMAPIProp, IMAPITable, IProfAdmin, IMsgServiceAdmin, IProviderAdmin, IProfSect, IExchangeManageStore, IStorage. In addition, OutlookSpy displays IMAPIAdviseSink notifications for the relevant Extended MAPI interfaces: IMAPISession, IMAPIFolder, IMessage and all IMAPITable properties (hierarchy, contents, recipients, attachments, etc tables).

Below is an example for the IMessage interface, all other Extended MAPI interfaces can be browsed in a similar fashion. 

Properties tab displays a list of all available properties as returned by IMAPIProp::GetPropList() and IMAPIProp::GetProps(). 

Selecting any property in the list displays relevant information for that particular property in the right pane: for named properties, GUID, ID and Kind are shown; for some other properties, OutlookSpy tries to display symbolic value of the property (PR_OBJECT_TYPE, PR_PRIORITY and many others). For PR_RTF_COMPRESSED property, OutlookSpy decompresses and displays raw RTF text.

Clicking on the button next to the "Value" edit, displays property data in hex or as text.

Clicking on a "?" button next to the "Tag" edit launches browser to the search results on the MSDN site for all PR_xxx properties; for the named properties, http://www.cdolive.com/cdo10.htm is displayed (great source for many undocumented named properties).

Toolbar on top of the tab allows to
1. Open any property (using IMAPIProp::OpenProperty()). If successful, the resulting object will be displayed in a separate window.
2. Delete selected properties - keep in mind Outlook might crash if you delete some properties!
3. Edit selected property (PT_OBJECT, PT_BINARY types and PR_MV_xxx properties are not supported). If the property is successfully set, IMAPIProp::SaveChanges() is automatically called.
4. Save the list of properties to a text file.

You can also drag selected properties from one window to another - in this case OutlookSpy copies selected properties from the source to a target IMAPIProp derived interface.


 Attachments tab - shows a list of all attachments. Double click an attachments or click "Open Attachment" button to browse the corresponding IAttach interface.
 Recipients tab - shows a list of all message recipients along with each recipient properties.

Double click on a recipient or click "Open Recipient" button to browse the corresponding IMailUser or IDistList interface.

 IMsgStore::Advise() tab - OutlookSpy displays Extended MAPI notifications for the relevant Extended MAPI interfaces. An example shows notification results after marking the message read and then unread.

Many more Extended MAPI interfaces are supported - see above.

CDO Objects

OutlookSpy allows to browse CDO objects in a fashion similar to Outlook Object Model interfaces. 4 CDO interfaces are available from the OutlookSpy toolbar: Session, InfoStore, Folder and Message.

CDO must be installed, otherwise "CDO" button is not available. Note that Outlook 2000 (unlike Outlook 97/98) does not install CDO by default. To install CDO with Outlook 2000, either re-run Outlook setup, select "Custom setup" and check "Collaboration Data Objects" checkbox or download it from the Microsoft web site: http://www.microsoft.com/exchange/downloads/CDO.htm .

Due to CDO limitations (lets call it what it actually is - a bug), even if the selected item is an appointment or a contact, OutlookSpy will still show it as a Message object due to the fact that CDO and Outlook share the same MAPI session.