Freigeben über


IMessengerContact::Property property

[Property is no longer available for use as of Windows Vista. See Windows Messenger for more information.]

Reserved.

This property is read/write.

Syntax

HRESULT put_Property(
  [in]          MPHONE_TYPE ePropType,
  [in]          VARIANT     vPropVal
);

HRESULT get_Property(
  [in]          MPHONE_TYPE ePropType,
  [out, retval] VARIANT     *pvPropVal
);

Property value

A pointer to a VARIANT that contains the property value. (Variant type differs depending on the property being set or retrieved.)

Error codes

Returns one of the following values.

Name Meaning
S_OK
Success.
E_INVALIDARG
ePropType is out of range (not within MCONTACTPROPERTY range).
RPC_X_NULL_REF_POINTER
vPropVal is a NULL pointer.

Remarks

The following table lists error codes returned by this method.

Error Code Meaning
0x80070057 ePropType is out of range (not within MCONTACTPROPERTY range); or, attempted to write to the property (property is read-only).

The Property property is scriptable for MCONTACTPROPERTY = MCONTACTPROP_GROUPS_PROPERTY, but read-only. The Property property is not scriptable for MCONTACTPROPERTY = MCONTACTPROP_EMAIL.

The bstrNumber return value may contain punctuation. Most APIs used for Internet telephony will either ignore or strip punctuation.

E_FAIL HRESULT will be returned for a contact who does not have phone information for the specified PhoneType parameter.

Note

This property is not available for scripting languages.

Examples

The following Visual Basic example shows the use of this method.

Public WithEvents MsgrUIA As MessengerAPI.Messenger 
Public MsgrContact As MessengerAPI.IMessengerContact 
Public MsgrGroups As MessengerAPI.IMessengerGroups 

Private Sub ContactGetProperty_Click() 
    On Error Resume Next 
    FormContactName.Show vbModal 
    'Get user input - select the contact 
    Set MsgrContact = Nothing 
    Set MsgrContact = MsgrUIA.GetContact(strContactName, strServiceID) 
    ... 
    ' Retrieves the number of groups the contact belongs 
    Set MsgrGroups = MsgrContact.Property(MCONTACTPROP_GROUPS_PROPERTY) 
    MsgBox(MsgrContact.SignInName & " is a member of " & MsgrGroups.Count & " groups") 
    ... 
    ' Retrieves the e-mail address of the contact 
    MsgBox(MsgrContact.SignInName & " e-mail address is " & MsgrContact.Property(MCONTACTPROP_EMAIL)) 
    ErrorTrap ("IMessengerContact.Property") 
End Sub

Requirements

End of client support
Windows XP
End of server support
Windows Server 2003
Header
Msgrua.h
IDL
Msgrua.idl
DLL
Msgsc.dll

See also

IMessengerContact

OnContactPagerChange