Calling Office Communicator via Silverlight Out of Browser

杀马特。学长 韩版系。学妹 提交于 2019-12-06 11:49:45

A couple thoughts:

Have you tried making the automated Communicator object a var, then setting a breakpoint and digging into the resulting hydrated object? You might find some methods or properties on the object you can use to make things happen.

There's a blog here that describes the Office Communicator SDK and has some sample projects. I think you might be able to include the SDK assemblies in your OOB app and automate Communicator using Microsoft's provided SDK.

The SDK has to be preinstalled in the user machines. There's no easy way to deploy it along your Silvelright OOB application.

You will need the SDK.

You can check the documentation for more details here: C:\Program Files (x86)\Microsoft Office Communicator\SDK\OCSDK.chm It mainly refers to C#, but most of it could easily be ported to Com Automation. As an example look at the following code to start a conversation

dynamic comm = new ActiveXObject("Communicator.UIAutomation");
dynamic msgrAdv = comm.IMessengerAdvanced;
if(msgrAdv!=null)
{
    try
    {
        object obj = msgrAdv.StartConversation(
                   1, //CONVERSATION_TYPE.CONVERSATION_TYPE_IM,
                   sipUris, // object array of signin names
                   null,
                   "Testing",
                   "1",
                   null);
        windowHandle = long.Parse(obj.ToString());
    }
    catch (COMException ex)
    {
        this.writeToTextBox(
                formReturnErrors.returnComError(ex.ErrorCode)
    );

}

I hope this help. Noticed that from the example in the help file I changed some of the members that are defined in the .NET Assembly (which can't be referenced from your C# code). If you need this, I would suggest opening the CommunicatorAPI.dll assembly in Reflector.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!