none
How does one properly and fully implement UCOfficeIntegration? RRS feed

  • Question

  • Hello,

    Does it exist a document describing how to properly and fully implemement UCOfficeIntegration?

    I am attempting to implement an IM Provider for Office 2010. When reading the document "Presence Integration between IM Applications and Microsoft Office 2010" it states that the Windows Messenger API should be implemented. Other threads in this forum informs me that the new interface is UCOfficeIntegration and when setting the registry keys for presence integration between IM applications and Microsoft Office 2010 this is the interface that is asked for.

    The UCOfficeIntegration interface itself is very small but it leads to LyncClient, Automation, Self, ContactManager, ContactSubscription, Contact, GroupCollection Group, ContactSettingDirectory, etc. Instead of guessing how all this should be implemented it would be nice if it was documented and if an example implementation existed. Does any documentation or examples exists and where do I find them?

    --T--

    Friday, February 17, 2012 1:21 PM

Answers

  • Hi Tommy,

    I will do my best to help you but this type of integration is not typically done in the scope of a forum post. Here are some answers to your questions and some other additional thoughts:

    1. There is no sample or official documentation on how to go about doing this.  The Windows Messenger interfaces should be documented as well as the the 2010 interfaces found here: http://msdn.microsoft.com/en-us/library/uccollaborationlib.aspx.

    2. You should start by implementing the Windows Messenger interfaces first.  This is the best starting point and will allow you to work with Office 2007 and Office 2010. The UCOfficeIntegration and other interfaces are only needed to "light up" the newer features in Office 2010.

    3. If you want to see where Office is having trouble communicating with your provider go to this TechNet article and enable Office and Communicator Integration Logging

    4. You should implement these interfaces in COM directly.  .NET can be used by I wouldn't recommend it.

    5. You should go and read my other posts on this subject if you haven't already.  They may be helpful.

    Dave


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.


    Friday, February 24, 2012 6:35 PM

All replies

  • Hi Tommy,

    Thank you for posting.

    You can find the Lync SDK from the MSDN library:

    http://msdn.microsoft.com/en-us/library/hh378547.aspx

    I tried to search the LyncClient and get the information about this class:

    http://msdn.microsoft.com/en-us/library/hh378537.aspx

    Hope this can help you and just feel free to follow up after you have tried.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 20, 2012 6:17 AM
  • Tommy, how about the problem on your side? Does the suggestion help you? If you still show any concern on the problem, just feel free to let us know.
    Best Regards,

    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, February 23, 2012 6:28 AM
  • Hi Bruce,

    Thank you for your answer! 

    My main problem is that I do not get the presence information (i.e. the colored balls next to the contact) displayed properly in Outlook. In my implementation I have hard coded the presence to always be available but when opening a mail the presence information is displayed a bit randomly, slowly and sometimes I need to hover above a contact to make the presence information show (i.e. to turn from white to green). Quite often I never get any presence information in the From: contact even though the same contact is visible with proper presence information in the To: field. 

    What I am trying to accomplish is to have the presence indications in Outlook to show the presence I supply in a fast and consistent manner. Implementing all the classes and interfaces that are found through the UCOfficeIntegration interface gets me a bit on the way but there are a lot of information missing.

    It seems like Outlook gets the presence information from two methods on Contact (of which only one is in the documentation). GetContactInformation() and BatchGetContactInformation(). BatchGetContactInformation() returns a ContactInformationDictionary but I notice that Outlook only calls the method Values() on it which indicates that the order of the array returned is important but since neither BatchGetContactInformation() nor ContactInformationDictionary are documented there is no way to know which order it should be.
    I assume that the order should be the same as in the ContactInformationType[] array which is the argument to GetContactInformation(), but that is just a guess.

    In the ContactInformationDictionary, Outlook tries to obtain ucContactExchangeServiceEntryId. Where do my implementation obtain the correct value for this and is it even important?

    Outlook creates a number of ContactSubscriptions. When reading the documentation there is no mention of how the subscription notifies Outlook regarding any changes in the Contact. A guess here is that it is done through _IContactEvents obtained through IConnectionPointContainer. Is this correct?

    Calling OnContactInformationChanged() on that interface for a contact seems to cause a BatchGetContactInformation() to be called on that contact but it does not improve my presence display in Outlook.

    It is difficult for me to get any further without more information regarding how Outlook handles presence so if someone could describe it for me or point me towards some documentation it would be most helpful.

    Best Regards,

    Tommy
    Thursday, February 23, 2012 3:33 PM
  • Tommy,I will help you involve others to help you. There might be some delay about the response. Appreciate your patience.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

    Friday, February 24, 2012 2:14 AM
  • Hi Tommy,

    I will do my best to help you but this type of integration is not typically done in the scope of a forum post. Here are some answers to your questions and some other additional thoughts:

    1. There is no sample or official documentation on how to go about doing this.  The Windows Messenger interfaces should be documented as well as the the 2010 interfaces found here: http://msdn.microsoft.com/en-us/library/uccollaborationlib.aspx.

    2. You should start by implementing the Windows Messenger interfaces first.  This is the best starting point and will allow you to work with Office 2007 and Office 2010. The UCOfficeIntegration and other interfaces are only needed to "light up" the newer features in Office 2010.

    3. If you want to see where Office is having trouble communicating with your provider go to this TechNet article and enable Office and Communicator Integration Logging

    4. You should implement these interfaces in COM directly.  .NET can be used by I wouldn't recommend it.

    5. You should go and read my other posts on this subject if you haven't already.  They may be helpful.

    Dave


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.


    Friday, February 24, 2012 6:35 PM
  • Hi Dave,

    Thank you for the answers and information. The biggest discrepancy between my implementation and the documentation is that I do not see where IMessenger is used. 

    How and where is the IMessenger interface obtained and invoked? 

    I have followed the instructions in "Presence Integration between IM Applications and Microsoft Office 2010" which only states to set a couple of registry keys and then implement the IMessenger interface. 
    When I do that, the first interface that Outlook asks for is UCOfficeIntegration. On UCOfficeIntegration it calls GetInterface() to obtain Automation and LyncClient. From there it unravels all other objects like ContactManager, Self, Group, etc.

    Since I cannot see where the IMessenger interface is used it seems like I am missing something substantial. At which stage does Outlook attempt to use IMessenger?

    Best Regards,

    Tommy

    Monday, February 27, 2012 4:56 PM
  • Hi Tommy,

    If you used the document you referenced then you are most likely registered as a "new" provider.  This means that Office sees you as a provider who implements the new set of interfaces.  However, I strongly encourage you to register yourself as a "legacy provider" until you have sucessfully implemented all of the IMessenger* interfaces and have your solution working.  To tell Office that you are a "legacy provider" follow the steps outlined in this document instead:

    Office Communicator 2007: Presence Integration Between IM Applications and 2007
    Microsoft Office System

    http://www.microsoft.com/download/en/details.aspx?amp;displaylang=en&id=7402

    After registering yourself in that manner, Office should start communicating with you via the IMessenger interfaces.  Once you have all that working you can start working on the new interfaces.

    Dave

    Tuesday, February 28, 2012 10:28 PM
  • Hi Dave,

    I found out why Outlook always used UCOfficeIntegration and that is because I have Lync installed. On a machine where Lync is not installed Outlook uses the IMessenger interface. 

    My question is then, is it possible to control which interface Outlook uses without installing Lync?

    When using the IMessenger interface I noticed that it is not possible to initiate IM, audio and video calls from the contact card in Outlook 2010. It looks like it should be possible through the IMessengerAdvanced interface which has a method called StartConversation(). Is it possible to enable initiating calls from the contact cards using a IMessenger* interface or is that only possible from UCOfficeIntegration?

    Best Regards,

    Tommy

    Thursday, March 15, 2012 5:37 PM
  • Hi Tommy.

    I was in your situation a few months ago. Currently I have a working solution, albeit with a few caveats, using the IMessenger "legacy" interface, but have just started implementing the Collaboration interface.

    Hopefully the following observations will be helpful to you:

    • The integration with 2007 is almost like a hack of "Communicator" whereby the third party presence app pretends to be Communicator.
    • The integration with 2010 is more standalone, and it is possible to coexist with Lync. Outlook decides which provider to use from the registry entry \HKEY_CURRENT_USER\Software\IM Providers\DefaultIMApp. If you have the tracing enabled, as Dave describes, you can see the difference between an application that implements the Messenger interface and one that implements the UCOfficeCollaboration one ==> the former contains the lines

           CMsoIMProviderFactory::WhichMessengerInProcessList Using (<your app name>.vshost.exe) process name for search

           CMsoProviderOCom::IsMyProviderType !failed!  Line: 345  hr = 0x80004002

           whereas the latter doesn't have the !failed!. That's my way of identifying them.

    • IMessenger provides you a means of starting a conversation (calls and IMs) if you implement Messenger and IMessengerAdvanced (I also implement IMessengerContactResolution for good measure). You can then start a conversation and that would hook into "StartConversation". The "GetAuthenticationInfo" method needs to return "<authenticationinfo><protocol>sip_kerberos</protocol></authenticationinfo>".
    • The reason I am implementing the Collaboration interface is because I need to hook into Desktop Sharing, and I can't see a way of doing with the Messenger interface. The same applies to Video calls. My second guessing with Messenger was easy-ish as you can simply create a client app that instantiates the interface, and see what Lync/Communicator returns. However, I haven't seen a single example of an app which instantiates the UCOfficeIntegration interface; the Lync SDK examples only use LyncClient.
    • Outlook 2010 doesn't update the presence of the person in the From: properly. This happens with both Lync and my app, so I can rule out issues with my implementation, it must be a bug with 2010.
    • My main caveat with the Messenger implementation is that I don't know how long the references to the contacts remain in memory by Outlook, so my solution is keeping them in memory for as long as my app is running. I have asked about it in another thread, but haven't got a response so far. Have a look at the other threads I've started or collaborated, there is more info you may find useful.
    • I agree that the API documentation for UCOfficeIntegration is very incomplete; the Messenger one is reasonably ok.

    Let me know how you get on and if you need more info.

    Regards,

    Alex

    Tuesday, March 20, 2012 2:45 PM
  • Hi Alex,

    Thank you very much for the information. Especially regarding the bug that the presence of the From: user is not updated properly. That has bugged me a lot and it is good to know that it is not a small issue with my implementation. I have also noticed that the presence is not initially updated properly on persons in your contact list, i.e. Groups obtained from ContactManager. The sluggishness I initially experienced was because of OfficePresenceLogging which slows down the presence updates surprisingly much.

    Regarding my initial question regarding documentation I think Dave answered it. There is no explicit documentation regarding the steps needed to implement IUCOfficeIntegration but the interface and classes around it are well documented. (except BatchGetContactInformation and ContactInformationDictionary on Contact)

    I have also figured out what decides which interface that Outlook uses to communicate with the IM Provider. It's the type libraries installed! My new computer did not even have IMessengerAdvanced installed (but strangely IMessenger) so everything went through IMessenger and I could not get Outlook 2010 to enable the Call icons in the contact cards. Since "Microsoft Office Communicator 2007 API Type Library" is possible to obtain I just compiled msgrua.idl to msgrua.tlb, installed it and presto! I had IMessengerAdvanced working. 

    That is why IUCOfficeIntegration is used when Lync is installed since Lync installs "Unified Collaboration API 1.0 Type Library" which is where IUCOfficeIntegration comes from. Sadly, Lync removes both those type libraries when unistalled (not even IMessenger remains) so any IM Provider will be broken if Lync is uninstalled. This also means that any IM Provider will have to install at least "Microsoft Office Communicator 2007 API Type Library" to at least get IMessengerAdvanced plus also to have the possibility to repair the damage done if Lync is uninstalled. But that issue is off topic for this thread so I will start a separate thread for that.

    Best Regards,

    Tommy
    Tuesday, March 27, 2012 2:19 PM
  • Hi Tommy,

    have you finished this project? Could you integrated UCOfficeIntegration?

    best regards,

    Cleber

    Friday, September 27, 2013 6:21 PM
  • Hi Tommy,

    Could you please share experience if you integrated UCOfficeIntegration?

    best regards,

    Krish

    Tuesday, March 22, 2016 1:20 PM