none
What is the prgram/clsid for com classes to access global address list RRS feed

  • Question

  • I am a java developer who needs to access global address list using

    JACOB - Java COM Bridge

    I can successfully access outlook contacts using a code like:

    ActiveXComponent component = new ActiveXComponent("Outlook.Application");

                    Dispatch oOutlook = (Dispatch) component.getObject();

                    Object oNameSpace = component.getProperty("Session").toDispatch();

                    Dispatch contacts = Dispatch.call((Dispatch) oNameSpace,"GetDefaultFolder", new Integer(10)).toDispatch();

                    Dispatch dl=Dispatch.call(contacts,"Items",dlName).toDispatch();

                    //Dispatch member=Dispatch.call(dl,"GetMember",new Variant(1)).toDispatch();//Returns recipient object

                    @SuppressWarnings("deprecation")

                    int x=Dispatch.call(dl, "MemberCount").toInt();

    But I am interested in getting similar information programmatically from Global Address List which I think is stored in an Active Directory or some exchange server.

    Can anyone provide pointers how can I do it. Can I still use ActiveXComponent Outlook.Application?

    What is the program id/CLSID, e.eg., 10 used below but that is for outlook I think for Getting Default Folder?

                    Dispatch contacts = Dispatch.call((Dispatch) oNameSpace,"GetDefaultFolder", new Integer(10)).toDispatch();

    Any pointer will be greatly appreciated including which forum I can ask this question, if .NET  framework forum is not the right one.

    Saturday, December 2, 2017 2:46 AM

All replies

  • What is the program id/CLSID, e.eg., 10 used below but that is for outlook I think for Getting Default Folder?        

    This default folder is just an Enum : OlDefaultFolders enumeration

     public enum OlDefaultFolders
        {
            olFolderDeletedItems = 3,
            olFolderOutbox = 4,
            olFolderSentMail = 5,
            olFolderInbox = 6,
            olFolderCalendar = 9,
            olFolderContacts = 10,
            olFolderJournal = 11,
            olFolderNotes = 12,
            olFolderTasks = 13,
            olFolderDrafts = 16,
            olPublicFoldersAllPublicFolders = 18,
            olFolderConflicts = 19,
            olFolderSyncIssues = 20,
            olFolderLocalFailures = 21,
            olFolderServerFailures = 22,
            olFolderJunk = 23,
            olFolderRssFeeds = 25,
            olFolderToDo = 28,
            olFolderManagedEmail = 29,
            olFolderSuggestedContacts = 30
        }

    Saturday, December 2, 2017 8:36 AM