Determining selected Contact (in a contacts-type folder):   Return to List

Public Sub Main()
Dim itmContact As ContactItem
Set appOL = Outlook.Application
Set myContactExpl = appOL.ActiveExplorer
strCurrFolder = myContactExpl.CurrentFolder
If strCurrFolder <> "Contacts" Then ' incorrect folder
    Call DisplaySelectionError
    Exit Sub
Else
    If myContactExpl.Selection.Count = 0 Then ' nothing selected
        Call DisplaySelectionError
        Exit Sub
    Else
        Set itmContact = myContactExpl.Selection.Item(1)
        MsgBox "Selected " & itmContact.FullName
    End If
End If
End Sub



Note to Webmaster