sub function + contact

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What would the sub function be to get the code to fire when a contact is
double clicked to open?
 
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
 
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
 
Back
Top