none
import/export contactperson table between Ms Office and MS Access and visa versa RRS feed

  • Question

  • Hello experts,

    I like to get the contactpersonsinformation which I have stored in my MS Acces database into MS Outlook, so that I don't have to add this separately. I have tried

    Dim myOlApp As New Outlook.Application
    Dim myNamespace As Outlook.Namespace
    Dim myFolder As Outlook.Folder
    Set myNamespace = myOlApp.GetNamespace("MAPI")
    Set myFolder = myNamespace.GetDefaultFolder(olFolderContacts)
    myFolder.Display

    which enables me to insert data manually for a particular person. But I don't know how to do this for a complete MS Access table automatically 

    I also don't know how to get the information from Outlook into an Excell or Access table.

    I looked to previously answered questions related to this one, but unfortunately they were of little help for me so far.

    thanks/regards

    Jantje

    Monday, May 20, 2013 5:19 PM

Answers

  • You need to actually create a contact:

    set myContact = myFolder.Items.Add("IPM.Contact")
    myContact.FirstName = "Joe"
    myContact.LastName = "User"
    myContact.Email1Address = "joe.the.user@example.demo"
    myContact.Save


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, May 20, 2013 5:29 PM

All replies

  • You need to actually create a contact:

    set myContact = myFolder.Items.Add("IPM.Contact")
    myContact.FirstName = "Joe"
    myContact.LastName = "User"
    myContact.Email1Address = "joe.the.user@example.demo"
    myContact.Save


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, May 20, 2013 5:29 PM
  • Hello Dimitry,

    This works now perfectly. Many thanks. But now the other way from MS Outlook to MS Access. This is because I like to synchronise the data from my Access program and Outlook and I have to test each contact for which is updated last. So could you also help me with exporting from Outlook into an access table, preferably with code in Acces, so not in Outlook?

    best regards and thanks for your help sofar!

    Jantje

    Monday, May 20, 2013 9:02 PM