Try this code in the ThisOutlookSession module:
Dim WithEvents colInsp As Outlook.Inspectors
Private Sub Application_Startup()
Set colInsp = Application.Inspectors
End Sub
Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class = olContact Then
MsgBox "Hello World!"
End If
End Sub
If you're new to Outlook VBA macros, these web pages should help you get started:
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers