Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Nicolas B.
Salut Jean-Marc,
Essaye cette macro qui importe trois propriétés possibles d'un contact :
Sub ImporterContact() Dim ol As Outlook.Application Dim Contact As Outlook.ContactItem
Set ol = CreateObject("Outlook.Application") Set Contact = ol.GetNamespace("MAPI").GetDefaultFolder _ (olFolderContacts).Items.Find("[FileAs] = ""Dupont, Jean""") If Not TypeName(Contact) = "Nothing" Then With Contact Cells(1, 1) = .FullName Cells(2, 1) = .CompanyName Cells(3, 1) = .Email1Address End With Else MsgBox "Le contact n'existe pas." End If End Sub
Il faut cocher Microsoft Outlook X Object Library dans les références VBA.
A+ -- Nicolas B.
Bonjour, Est-il possible avec une macro d'importer un contact Outlook dans une cellule Excel ? Merci Jean-Marc
Salut Jean-Marc,
Essaye cette macro qui importe trois propriétés possibles d'un contact :
Sub ImporterContact()
Dim ol As Outlook.Application
Dim Contact As Outlook.ContactItem
Set ol = CreateObject("Outlook.Application")
Set Contact = ol.GetNamespace("MAPI").GetDefaultFolder _
(olFolderContacts).Items.Find("[FileAs] = ""Dupont, Jean""")
If Not TypeName(Contact) = "Nothing" Then
With Contact
Cells(1, 1) = .FullName
Cells(2, 1) = .CompanyName
Cells(3, 1) = .Email1Address
End With
Else
MsgBox "Le contact n'existe pas."
End If
End Sub
Il faut cocher Microsoft Outlook X Object Library dans les références VBA.
A+
--
Nicolas B.
Bonjour,
Est-il possible avec une macro d'importer un contact Outlook dans une
cellule Excel ?
Merci
Jean-Marc
Essaye cette macro qui importe trois propriétés possibles d'un contact :
Sub ImporterContact() Dim ol As Outlook.Application Dim Contact As Outlook.ContactItem
Set ol = CreateObject("Outlook.Application") Set Contact = ol.GetNamespace("MAPI").GetDefaultFolder _ (olFolderContacts).Items.Find("[FileAs] = ""Dupont, Jean""") If Not TypeName(Contact) = "Nothing" Then With Contact Cells(1, 1) = .FullName Cells(2, 1) = .CompanyName Cells(3, 1) = .Email1Address End With Else MsgBox "Le contact n'existe pas." End If End Sub
Il faut cocher Microsoft Outlook X Object Library dans les références VBA.
A+ -- Nicolas B.
Bonjour, Est-il possible avec une macro d'importer un contact Outlook dans une cellule Excel ? Merci Jean-Marc