Messages.count Property
Gets the number of System.MessageStore.Message items in the Messages collection.
This property is read-only.
Syntax
propVal = Messages.count()
Parameters
- intMessageCount [out]
Retrieves the number of items.
Remarks
Folders exposes the Windows Mail (formerly Outlook Express) Local Folders collection. Sub-folders and their content (such as messages) are not exposed.
Examples
The following example demonstrates how to access properties for a message in the Messages collection.
var sFlyoutContent = "";
var collFolders = System.MessageStore.Folders; ;
// --------------------------------------------------------------------
// Display the flyout.
// iFolderIndex: The index of the selected folder.
// --------------------------------------------------------------------
function ShowFlyout(iFolderIndex)
{
var iBodyLength;
var oMessage = null;
var collMessages = collFolders.item(iFolderIndex).Messages;
sFlyoutContent = "<p>" + collMessages.count + " Messages:</p>";
for (var loop = 0; loop < collMessages.count; loop++)
{
oMessage = collMessages.item(loop);
// Preview a maximum of 100 characters.
iBodyLength = 100;
if (oMessage.body.length < 100)
{
iBodyLength = oMessage.body.length;
}
sFlyoutContent += oMessage.from + "<br />";
sFlyoutContent += oMessage.subject + "<br />";
sFlyoutContent += oMessage.to + "<br />";
sFlyoutContent += oMessage.body.slice(0,iBodyLength) + "<hr />";
}
System.Gadget.Flyout.show = true;
}
Requirements
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
IDL | Sidebar.idl |
DLL | Sidebar.Exe version 1.00 or later |
See Also
Reference
Send comments about this topic to Microsoft
Build date: 2/24/2010
Build type: SDK