Share via


IMessenger::UnreadEmailCount property

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

Retrieves the current number of unread e-mail messages in the Inbox assigned to the currently signed-in client user.

This property is read-only.

Syntax

HRESULT get_UnreadEmailCount(
  [in]          MUAFOLDER mFolder,
  [out, retval] LONG      *plCount
);

Property value

A pointer to a LONG that provides the total number of unread e-mail messages in the client user's e-mail Inbox. This value is determined upon initial client sign-in. If a user accesses the Outlook.com Inbox and reads those messages, an OnUnreadEmailChange event will be issued; the client should use the value of the cUnreadEmail parameter in the event to get the new unread message count.

Error codes

For a table of MSGR_E_* constants, see MSGRConstants.

Returns one of the following values.

Name Meaning
S_OK
Success.
S_FALSE
No Inbox is available. This may be the result for Microsoft .NET Messenger Service users whose sign-in names are not in the outlook.com domain. If this is the case, plCount will be -1 to differentiate it from the following second case.
- or -
Returned for scripting only. Client not signed in.
RPC_X_NULL_REF_POINTER
plCount is a NULL pointer.
E_FAIL
Attempted to specify mFolder as a value other than MUAFOLDER_INBOX
MSGR_E_NOT_LOGGED_ON
Returned for Visual Basic and Visual C++ only. Client is not signed in. Client must be signed in to check this value. If this error result is returned, plCount will be returned as -1.

Remarks

When this method is invoked on a Microsoft Exchange Instant Messaging Service (IM) client, Exchange through Microsoft Outlook will always be invoked as the mail client. Calling this method will not determine the unread e-mail count in that client or account. If a Microsoft .NET Messenger Service is signed in as a primary or secondary service to the Exchange IM service, this method will return the number of unread e-mail messages from the Outlook.com Inbox.

At sign-in, the Messenger client internally flags whether the Microsoft .NET Messenger Service user has an Outlook.com Inbox. If so, the count is determined from the Outlook.com Inbox.

If the user does not have an Outlook.com Inbox, no value can be returned (will return -1). For information about why not all Outlook.com service users have Inboxes, see OpenInbox.

To use this method in Windows Messenger, you must install an add-in component that supports e-mail integration.

For users who are not signed in, calling this method will not return a plCount value at all (VT_EMPTY, not zero) and will not result in an error.

Note

The following remarks apply for scripting languages.

  • This property is scriptable.
  • You should not return MSGR_E_NOT_LOGGED_ON to avoid an exception.
  • Clear the value returned to the user.

Requirements

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