none
Read Contacts from Outlook 2007 Address Book

    Question

  • Hi,
    I want to import contacts from address book of Outlook 2007 into my application.
    I am using VB.NET 2008 SP1 .NET Framework 2
    Because I am in .NET environment, I don't want to rely on COM objects or outlook objects which requires it to be installed on the system.
    Is there a way I can read the contacts?
    And at a glance, where are contacts stored by outlook?
    Thanks Smile
    Wednesday, January 07, 2009 5:18 PM

Answers

  • Hi,
    Thanks you are great Smile
    1. No we don't have exchange
    2. Yes, I mean contacts folder
    3. So,  I give it up, I don't use COM components in my .NET applications...
    Thank you very much Smile
    Saturday, January 24, 2009 5:30 PM

All replies

  • Hi,

     

    Thank you for contacting Microsoft Innovate On Office Advisory Services.

     

    Following are the details of your request:

     

     Support Request Description:

    - Do you want to know how to read the contacts from the Outlook 2007?

    - You also want to know where the contacts stored by outlook are.

     

     Next Step:

    Please provide us the following information

    ·         Which programming language do you want to use to achieve this functionality?

     

    To know where outlook stores its contacts, refer to this third party link:

    http://www.slipstick.com/config/backup2007.asp

     

     

     Thanks,

    Dhanashri.

    Disclaimer:

    The links in this message may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

    Wednesday, January 07, 2009 8:11 PM
  • Hi and thanks Smile
    VB.NET 2008 SP1 .NET Framework 2.0

    So that's my programming language, and yes I wanna know how to read contacts from Outlook 2007?
    I want to import contacts from Outlook 2007 to my application.

    Also, if possible it's a good idea if I will be able to export back contacts from my application to Outlook also!

    Thank you very much Smile
    Wednesday, January 07, 2009 9:48 PM
  •  

    Thanks for the information.

     

    But I am trying to know..do you want to export and import contacts in outlook 2007 programmatically?

    if so ..is it by using VSTO or VBA or any other technology?

     

    Thanks,

    Dhanashri.

    Thursday, January 08, 2009 11:04 PM
  • Hi,
    Thank you for your replySmile
    Yes, of course I wanna import and export contacts in Outlook 2007 pro grammatically.
    I want to do it by Visual Basic .NET 2008 SP1, .NET Framework 2.0 and please note that my project is not Visual Studio Tools for Office or VBA, my project is Standard Windows Application type and will be in pure VB.NET language, I also don't want to import/use COM object based components in my .NET application and also don't want to rely on Office components installed on the system...
    Regards.
    Friday, January 09, 2009 12:12 AM
  •  

    Hi,

    we apologize for the delayed reply.

     

    so here we come up with few questions for you:

     1) Do you have an exchange in the environment. If yes what's the Version?

     2) When you say address book, are you talking about the contacts folder?

     3) If you have an exchange in your enviornment and you are talking about the contacts, then we might be able to help.

      Other wise OOM(Outlook Object Model) is the only way out..

     

     

    Thanks,

    Dhanashri.

    Monday, January 12, 2009 9:11 PM
  • Would it be possible for you to also send a screen shot for what you mean by

    Outlook Address Book?

    My email id is dppatil@hotmail.com

     

    Thanks,

    Dhanashri

     

     

    Monday, January 12, 2009 9:27 PM
  • Hi,
    Thanks you are great Smile
    1. No we don't have exchange
    2. Yes, I mean contacts folder
    3. So,  I give it up, I don't use COM components in my .NET applications...
    Thank you very much Smile
    Saturday, January 24, 2009 5:30 PM
  • Thanks for the reply.

     

    -Dhanashri

     

    Tuesday, January 27, 2009 10:14 PM
  • I don't mind using COM.  I am able to get the required information for the Default Contacts Folder, but cannot do so for an IMAP account such as MyName@Hotmail.Com; it appears as separate folder under Contacts.  I am using the following code successfully for the Default Contacts Folder:

        Public Overrides Function Load() As Boolean
            Dim bResult As Boolean = False
            Dim oOutlook As Outlook.Application = Nothing
            Dim oNameSpace As Outlook.NameSpace
            Dim oConFolder As Outlook.MAPIFolder = Nothing
            Dim oConItems As Outlook.Items = Nothing
            Dim oConItem As Outlook.ContactItem

            Try
                oOutlook = New Outlook.Application
                oNameSpace = oOutlook.GetNamespace("MAPI")
                oNameSpace.Logon("", "", False, True)
                oConFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
                oConItems = oConFolder.Items

                For Each oConItem In oConItems
                    Console.WriteLine("[" & oConItem.Email1DisplayName & "]: <" & oConItem.Email1Address & ">")
                    Console.WriteLine("[" & oConItem.Email2DisplayName & "]: <" & oConItem.Email2Address & ">")
                    Console.WriteLine("[" & oConItem.Email3DisplayName & "]: <" & oConItem.Email3Address & ">")
                Next
            Catch ex As Exception
                SSUtils.ShowErrorEx(ex, "Error in ContactsOutlook2007.Load()", True, True)
                bResult = False
            Finally
                oConItem = Nothing
                oConItems = Nothing
                oConFolder = Nothing
                oNameSpace = Nothing
                oOutlook = Nothing
            End Try

            Load = bResult
        End Function

    Wednesday, February 18, 2009 7:58 AM
  • If the Outlook Address Book is not added;>

    1. click the Add… button
    2. select Additional Address Books and click Next
    3. choose Outlook Address Book and click Next
    4. You’ll be prompted that you must close and restart Outlook for changes to take effect
    5. Press OK and close and restart Outlook
    6. The service is now added .
    Good look
    Saturday, May 16, 2009 5:42 PM