Re: Outlook Kontakte
16.09.2002 19:13:38
Markus
Hey!Ich kapier das einfach nicht.
Ich kann kein benutzerdefiniertes Feld auslesen.
Sonst funktioniert alles mit dem folgendem Code:
Option Explicit
Sub Kontakte()
Dim olAppl As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olMAPIFolder As Outlook.MAPIFolder
Dim olItems As Outlook.Items
Dim olResItems As Outlook.Items
Dim olContact As Outlook.ContactItem
Dim intCounter As Integer
Dim sFilter As String
On Error GoTo byebye
Set olAppl = CreateObject("Outlook.Application")
Set olNS = olAppl.GetNamespace("MAPI")
Set olMAPIFolder = olNS.GetDefaultFolder(olFolderContacts)
Set olItems = olMAPIFolder.Items
sFilter = "[MessageClass] = 'IPM.Contact'"
Set olResItems = olItems.Restrict(sFilter)
Dim a As Variant
Set a = olContact
For Each olContact In olResItems
intCounter = intCounter + 1
Cells(intCounter, 1) = olContact.Birthday
Cells(intCounter, 2) = olContact.FirstName
Cells(intCounter, 3) = olContact.LastName
Next olContact
byebye:
Set olResItems = Nothing
Set olItems = Nothing
Set olMAPIFolder = Nothing
Set olNS = Nothing
Set olAppl = Nothing
Exit Sub
End Sub
Weist du noch was?