Salut à tous,
Long time no see, ça fait un bail que je n'ai plus traîné sur ces forums.
Je suis sur un projet en VBA sous Excel 2010.
J'ai une fonction qui récupère des Outlook.ContactItem dans un carnet d'adresse partagé.
Jusqu'ici, tout va bien, j'arrive à manipuler l'objet dans ma fonction etc..
Je veux que cette fonction retourne un tableau contenant les ContactItem.
Mais en fait elle retourne un tableau de String.
Est-il possible de faire ce que je veux faire ?
Le nom de la fonction est getSPContacts, et je lui passe mon tableau tableoutlook qui contient bien des Outlook.ContactItem.
Merci !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 For i = 0 To fld.Items.Count Set itm = fld.Items(i) If (uneMethode = 1 And unParam = itm.CompanyName) _ Or (uneMethode = 2 And unParam = itm.FullName) _ Or uneMethode = 0 Then ReDim Preserve tableoutlook(0 To z) tableoutlook(z) = itm z = UBound(tableoutlook) + 1 End If Next i Set fld = Nothing Set ol = Nothing getSPContacts = tableoutlook
*.Har(d)t
Partager