Opens the Phone Call dialog box. Not scriptable.


   [in] VARIANT vContact,
   [in] MPHONE_TYPE ePhoneNumber,
   [in] BSTR bstrNumber,
   retval] IDispatch** ppMWindow



[in] A VARIANT that can take as its value either a VT_BSTR string or a VT_DISPATCH pointer to an existing IMessengerContact object. If the input value type is a string, this method creates a new MessengerContact object internally. If the input value type is a pointer to an existing MessengerContact object (should be type VT_DISPATCH), the existing object is used.


[in] A value of the enumeration MPHONE_TYPE that specifies the type of telephone number that you are calling.


[in] A BSTR that contains the telephone number that is entered in the text box in the Phone Call dialog box. No validation is performed on this string. For information about the format of the phone number, see the "Remarks" section below. If the bstrNumber parameter is given as a null string, the text box of the new dialog box is initially blank.


[out, retval] A pointer to a pointer to the IDispatch interface on a MessengerWindow object, which can be accessed through the IMessengerWindow interface that is used to call other automation-accessible properties, such as the IMessengerWindow::Height property, the IMessengerWindow::Width property, the IMessengerWindow::Top property, the IMessengerWindow::Left property, and the IMessengerWindow::Show method. This parameter cannot be null.

Return Value

For a table of all MSGR_E_* constants, see Error Codes.

Returns one of the following values. For managed code applications, these return values are received in the form of a COMException.




The method could not create a Phone Call dialog box or you called this method against the local client user.


The client is not signed in the primary service at the time this method is called.


The Phone Call dialog box is already open.


One of the following:

  • vContact is null, points to a null string, or points to a string that has a space as the first character.

  • vContact is a VT_BSTR that exceeded 129 characters.

  • vContact is a VT_BSTR and contains a carriage return or linefeed.

  • The phone type is out of range.

  • bstrNumber exceeds 256 characters.


The service for the contact whom you are attempting to call does not support phone calls.


The contact whom you are attempting to call does not have the given phone-type number set.


The local computer or local user policy does not allow users to make phone calls.


ppMWindow should be released when it is no longer needed.

Only one Phone Call dialog box can be active at one time. Calling the IMessenger::Phone method multiple times returns S_OK, not S_FALSE. The phone number displayed in the dialog box is the phone number entered as a parameter in the most recent method call.

In anticipation of numbers that exceed normal limits because of extensions, key sequences for private uses, and so on, there is no enforcement of string length for the bstrNumber parameter. There is a physical limit to the display of strings in the dialog box.


The following example demonstrates starting a phone call dialog box from the Office Communicator UI using the supplied parameters. In this case, an IMessengerContact object (foundContact) is passed to the method along with the contact's telephone type and telephone number. The telephone number is optional and if omitted, the telephone dialog opens but the call is not placed. The IMessengerWindow object can be used to manipulate the opened telephone dialog. For illustration purposes, the phone dialog window is closed immediately after it is opened. Closing the phone dialog in this way causes the UI to display a dialog confirming that the user wants to end the telephone call.

Copy Code
IMessengerContact IMContact = (IMessengerContact)communicator.GetContact(

if (communicator != null && IMContact != null)
   IMessengerWindow phoneWindow;
	 phoneWindow = (IMessengerWindow)communicator.Phone(IMContact, MPHONE_TYPE.MPHONE_TYPE_WORK, foundContact.get_PhoneNumber(MPHONE_TYPE.MPHONE_TYPE_WORK));
	 if (phoneWindow != null)
   catch (COMException MPCE)



Requires Microsoft DirectX 9.0, C Runtime libraries (msvcm80.dll) on Microsoft Windows© Vista, Microsoft Windows XP Service Pack 1 (SP1) or later, or Microsoft Windows 2000 with Service Pack 4 (SP4). Any Communicator-imposed restrictions apply. .


Requires Microsoft Office Communications Server 2007, AV MCU (for Media Support), Media Relay (for NAT/Firewall traversal) on Microsoft Office Communications Server 2007.


Microsoft Office Communicator 2007 Automation API

IDL file


See Also