sub function + contact

K

kbreiss

What would the sub function be to get the code to fire when a contact is
double clicked to open?
 
K

kbreiss

Thanks for the reply Sue...I'm not for sure how to do that. What I'm looking
for it when I double click a contact from the "Contacts" screen a message box
will appear.

Private ????????()
msgbox "Hello'
End Sub

Thanks,
Kacy
 
S

Sue Mosher [MVP-Outlook]

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
 
Top