This documentation is archived and is not being maintained.

Interface Member Invocations

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

After a Communicator object (implementing the IMessenger and other interfaces) is created, you can call methods and properties of the interfaces implemented by the object. The following C# code shows an attempt to retrieve a specified contact listed in the connected Communicator.

CommunicatorAPI.Messenger communicator = new CommunicatorAPI.Messenger();

public IMessengerContact GetContact(string signinName)
    return communicator.GetContact(signinName, communicator.MyServiceId) as IMessengerContact;

Retrieving a contact in C/C++ is more involved than in C#. The following C/C++ code shows an attempt to retrieve a specified contact that is listed in the connected Communicator.

IMessenger m_pIMessenger = ...;

IMessengerContact* GetContact(BSTR bstrSigninName)
      // Get the ID of the service behind the connected Communicator.
      // Property invocation.
      BSTR bstrServiceId;
      hr = m_pIMessenger->get_MyServiceId(&bstrServiceId);
      if (FAILED(hr))
         return NULL;

      // Get the named contact: method invocation
      IMessengerContact* pIMessengerContact;
      hr = m_pIMessenger->GetContact(bstrSigninName, bstrServiceId, 
      if (FAILED(hr))
         return NULL;

      return pIMessengerContact;

var comm = new ActiveXObject("Communicator.UIAutomation");
var contact = GetContact("");

function GetContact(signinUri)
   var c = comm.GetContact(signinUri, comm.MyServiceId);
   return c;
For reasons of security, not all methods or properties can be called using JavaScript or another scripting language. Such restrictions are documented in Office Communicator Automation API Reference.