none
iCloud does not appear in Outlook.MAPIFolder RRS feed

  • Question

  • I would like to access my contacts in the "Contacts - iCloud" in Outlook 2010 (Contacts area)

    when i use the following code, in the Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

    "Outlook.OlDefaultFolders.olFolderContacts.iCloud" does not come up, so i can not access those contacts..... WHY......

     

    ' Create Outlook application.
            Dim oApp As Outlook.Application = New Outlook.Application
    
            ' Get namespace and Contacts folder reference.
            Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
               ' used to get the default "contacts" folder
            Dim MyFolder As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

    • Moved by Kee Poppy Tuesday, January 17, 2012 6:41 AM (From:Visual Basic General)
    • Moved by Cindy Meister MVP Tuesday, January 17, 2012 7:40 AM outlook-specific (From:Visual Studio Tools for Office)
    Saturday, January 14, 2012 5:52 PM

All replies

  • Hello,

    Probably the Visual Studio Tools for office is a better place for your question.

    http://social.msdn.microsoft.com/Forums/en/vsto


    Success
    Cor
    Sunday, January 15, 2012 8:57 AM
  • Hi bugsxxx,

    I am going to move this thread to Visual Studio Tools for Office forum for getting better support.

    Have a nice day,


    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, January 17, 2012 6:40 AM
  • Check if MyFolder (the one you obtained in your code) dooes have some folders in its Folders property, maybe this is how iCloud is implemented ?
    Tuesday, January 17, 2012 10:26 AM
  • There is no such enumeration member as "Outlook.OlDefaultFolders.olFolderContacts.iCloud".
     
    Is that Apple created folder under the default Contacts folder or somewhere else? How you locate it depends on the location. If it's a subfolder of Contacts you'd use something like this:
     
    Dim MyFolder As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
    Dim iCloud As Outlook.MAPIFolder = Myfolder.Folders("iCloud")

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "bugsxxx" <=?utf-8?B?YnVnc3h4eA==?=> wrote in message news:079e36ec-65c5-41d9-a4f9-20e278c5ad9b...

    I would like to access my contacts in the "Contacts - iCloud" in Outlook 2010 (Contacts area)

    when i use the following code, in the Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)

    "Outlook.OlDefaultFolders.olFolderContacts.iCloud" does not come up, so i can not access those contacts..... WHY......

     

    ' Create Outlook application.
            Dim oApp As Outlook.Application = New Outlook.Application
    
            ' Get namespace and Contacts folder reference.
            Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
               ' used to get the default "contacts" folder
            Dim MyFolder As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)


    Ken Slovak MVP - Outlook
    • Proposed as answer by VBAToolsMVP Tuesday, January 17, 2012 8:42 PM
    Tuesday, January 17, 2012 2:25 PM
    Moderator
  • Where exactly in Outlook do you see that folder? What is the folder path?
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Tuesday, January 17, 2012 2:25 PM
  • This is where my Contacts - iCloud   folder show up in outlook 2010

     

     

    Thanks for the help

    Tuesday, January 17, 2012 11:48 PM
  • as decribed above - try to find out if calendar folder you got has some subfolders in it, i.e. MyFolder.Folders.Count - if it is greater then 0, iterate through them and check their names and FullPath to see if one of them is your iCould's contacts container.
    Wednesday, January 18, 2012 7:45 AM
  • Kencan may have a right
    Dmitry, Today I received the same question, but I do not use this method stored contacts

    to iż nie miałem do tego dostępu rozwiązałem to w ten sposób I solved this just like that

    Dim olApp As Object 'New Outlook.Application
    Set olApp = CreateObject("Outlook.Application")
    Dim oFolder As Object 'Outlook.MAPIFolder
    Dim oKontakt As Object 'Outlook.ContactItem
    Dim olNs As Object 'Outlook.Namespace
    
    Set olNs = olApp.GetNamespace("MAPI")
    Set oFolder = olNs.PickFolder                         '<- Just like that and works right
    Call BlockEvScreenCalc(False, "Pobieranie danych...")
     For x = 1 To oFolder.Items.Count
     DoEvents
     If oFolder.Items(x).class = 40 Then
        Set oKontakt = oFolder.Items(x)
           With oKontakt
    '.......


     


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved


    • Edited by VBAToolsMVP Wednesday, January 18, 2012 8:50 AM This VBAEditor is like ^#&@(
    Wednesday, January 18, 2012 8:47 AM
  • Why not use

    set Store = olNs.Item("iCloud")

    set oFolder = Store.GetDefaultFolder(olFolderContacts)


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Wednesday, January 18, 2012 2:45 PM