Function ReadContacts() As Boolean Dim oApp As Outlook.Application Dim oNameSpace As Outlook.NameSpace Dim oContacts As MAPIFolder Dim oContact As Outlook.ContactItem
On Error GoTo Proc_Err
Set oApp = CreateObject("Outlook.Application") Set oNameSpace = oApp.GetNamespace("MAPI") Set oContacts = oNameSpace.GetDefaultFolder(olFolderContacts)
For Each oContact In oContacts.Items
Debug.Print oContact.FirstName Next
Proc_Exit:
On Error Resume Next
Set oContact = Nothing Set oContacts = Nothing Set oNameSpace = Nothing Set oApp = Nothing
fandt dette Dim ol As New Outlook.Application Dim ContactFolder As MAPIFolder
Private Sub Form_Load() Set ContactFolder = _ ol.GetNamespace(\"MAPI\").GetDefaultFolder _ (olFolderContacts) With ContactFolder.Items(1) Text1 = .FirstName End With
OK and thanks. Can you tell me which field it is in Outlook, I'm not quite sure!
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.