none
Connection with Outlook is slow? RRS feed

  • Question

  • I am accessing Outlook using Java. I am accessing the address book and extracting the organization chart under a particular user. Although, my program is taking 4-5 mins (which i guess is very large).

    I just wanted to know if there are any possible factors which i can correct so as to get a faster response.

    Thanks.



    • Edited by Anand_anand Tuesday, October 23, 2012 10:40 AM
    Tuesday, October 23, 2012 10:38 AM

All replies

  • It may be just that java is really slow. However, without seeing your code and evaluating it there's no way to tell if your code is optimized, or is handling the use of the Outlook object model in the most optimized way.
     
    I doubt that anyone would evaluate an entire program here in the forums, but small pieces of code where you find things taking the most time would be candidates for optimization.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Anand_anand" <=?utf-8?B?QW5hbmRfYW5hbmQ=?=> wrote in message news:e65c7ea7-52ec-40d8-996b-567c0986360f...

    I am accessing Outlook using Java. I am accessing the address book and extracting the organization chart under a particular user. Although, my program is taking 4-5 mins (which i guess is very large).

    I just wanted to know if there are any possible factors which i can correct so as to get a faster response.

    Thanks.




    Ken Slovak MVP - Outlook
    Tuesday, October 23, 2012 12:59 PM
    Moderator
  • Yes, as i mentioned i am trying to get the Organizational Chart under a particular user, for that I am looping for direct reports of a particular user. I think the following loop is taking time. The code snippet is as follows:

    oExUserDR: Just a variant for the direct reports of an exchange user.
    ------------------------------------------------------------------------------------------------------------------------------

    for(int i = 1; i <= count; i++) {

    directReports = Dispatch.get(Dispatch.call(oExUserDR,"Item",new Integer(i)).toDispatch(),"GetExchangeUser").toDispatch();

    //Create Manager element  // These lines are for creating a node in the XML file.
    objMgrElem = objElem.getOwnerDocument().createElement(strNodeName);
    objElem.appendChild(objMgrElem);

    //Set Element
    setElement(objMgrElem, directReports);
    dirEntry = Dispatch.get(directReports,"GetDirectReports").toDispatch();

    //Until dirEntry != NULL
    int dirCount = Dispatch.get(dirEntry,"Count").toInt();

    if (dirCount > 0)   
    printDirectReports(dirEntry,objMgrElem,"emp");
    }

    ----------------------------------------------------------------------------------------------------------------------------
    Please let me know if i am using OOM in an optimized way here, or if it can be improved in anyway. Thanks



    • Edited by Anand_anand Tuesday, October 23, 2012 3:06 PM
    Tuesday, October 23, 2012 3:05 PM
  • I'm sorry, I don't really see any usage of the Outlook object model in that code. I have no idea how your java code could be optimized.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Anand_anand" <=?utf-8?B?QW5hbmRfYW5hbmQ=?=> wrote in message news:b5338578-2269-42e1-855b-928299fc57ea...

    Yes, as i mentioned i am trying to get the Organizational Chart under a particular user, for that I am looping for direct reports of a particular user. I think the following loop is taking time. The code snippet is as follows:

    oExUserDR: Just a variant for the direct reports of an exchange user.
    ------------------------------------------------------------------------------------------------------------------------------

    for(int i = 1; i <= count; i++) {

    directReports = Dispatch.get(Dispatch.call(oExUserDR,"Item",new Integer(i)).toDispatch(),"GetExchangeUser").toDispatch();

    //Create Manager element  // These lines are for creating a node in the XML file.
    objMgrElem = objElem.getOwnerDocument().createElement(strNodeName);
    objElem.appendChild(objMgrElem);

    //Set Element
    setElement(objMgrElem, directReports);
    dirEntry = Dispatch.get(directReports,"GetDirectReports").toDispatch();

    //Until dirEntry != NULL
    int dirCount = Dispatch.get(dirEntry,"Count").toInt();

    if (dirCount > 0)   
    printDirectReports(dirEntry,objMgrElem,"emp");
    }

    ----------------------------------------------------------------------------------------------------------------------------
    Please let me know if i am using OOM in an optimized way here, or if it can be improved in anyway. Thanks




    Ken Slovak MVP - Outlook
    Tuesday, October 23, 2012 8:06 PM
    Moderator