XL 2010 Rechercher un contact dans outlook pour l'importer

Laosurlamontagne

XLDnaute Occasionnel
Bonjour à tous,

Je tente de créer une macro qui me permettrait d'aller rechercher un contact dans le carnet d'adresse outlook (du genre: je clique sur le bouton et je selectionne le contact).

En cherchant j'ai trouvé ceci:

VB:
Sub ShowContactsInDialog()
  Dim oDialog As SelectNamesDialog
  Dim oAL As AddressList
  Dim oContacts As Folder

  Set oDialog = Application.Session.GetSelectNamesDialog
  Set oContacts = _
    Application.Session.GetDefaultFolder(olFolderContacts)

  'Look for the address list that corresponds with the Contacts folder
  For Each oAL In Application.Session.AddressLists
    If oAL.GetContactsFolder = oContacts Then
        Exit For
    End If
  Next
  With oDialog
    'Initialize the dialog box with the address list representing the Contacts folder
    .InitialAddressList = oAL
    .ShowOnlyInitialAddressList = True
    If .Display Then
        'Recipients Resolved
        'Access Recipients using oDialog.Recipients
    End If
  End With
End Sub

Qui provient d'ici et qui semble parfaitement convenir à mon besoin. Cependant, elle ne marche pas en l'état et les explications données en fin d'article ne me permettent pas de "reconstruire" la macro. Sauriez-vous m'aider?
 

Discussions similaires

Statistiques des forums

Discussions
312 177
Messages
2 085 972
Membres
103 073
dernier inscrit
MSCHOE16