GetMessages Method
GetMessages Method
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.
Returns a collection containing the messages in the specified directory.
Applies To
Type Library
Microsoft CDO for Exchange 2000 Library
DLL Implemented In
CDOEX.DLL
Syntax
[Visual Basic]Function GetMessages
(
ByVal [DirName As String]
) As IMessages
[C++]HRESULT GetMessages ( BSTR DirName, IMessages** pVal );
Parameters
- DirName
The path to a directory that contains the messages. This parameter is optional, and if the empty string "" is specified, the currently defined SMTP drop directory is assumed.- pVal
Returned reference to an IMessages Interface.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
The collection returned by GetMessages contains Message objects derived from the files present in the directory at the time the method was invoked. The collection is not automatically updated when new messages arrive in the directory. To refresh the collection, call GetMessages again to retrieve a new collection.
Examples
[Visual Basic]
Dim iDropDir as New CDO.DropDirectory Dim iMsgs as CDO.IMessages Set iMsgs = iDropDir.GetMessages("c:\Inetput\mailroot\Drop") ' you now have the collection of messages ' in the SMTP drop directory ... Set iMsgs = iDropDir.GetMessages("c:\mymessages") ' you now have the collection of messages ' located in the directory c:\mymessages
[C++]
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace raw_interfaces_only #import <cdosys.dll> no_namespace raw_interfaces_only main() { CoInitialize(NULL);
IDropDirectory* pDropDir = NULL; IMessages* pMsgs = NULL; CoCreateInstance( __uuidof(DropDirectory), NULL, CLSCTX_INPROC_SERVER, __uuidof(IDropDirectory), (void**)pDropDir); // get collection from SMTP drop directory pDropDir->GetMessages(L"c:\Inetput\mailroot\Drop",&pMsgs); // ... pMsgs->Release(); // get collection from specific directory pDropDir->GetMessages(L"c:\mymessages",&pMsgs); // ... pMsgs->Release(); pDropDir->Release(); CoUninitialize(); return 1; }
Dim iDropDir Set iDropDir = CreateObject("CDO.Configuration") Dim iMsgs Set iMsgs = iDropDir.GetMessages("c:\Inetpub\mailroot\Drop") ' you now have the collection of messages ' in the SMTP drop directory ... Set iMsgs = iDropDir.GetMessages("c:\mymessages") ' you now have the collection of messages ' located in the directory c:\mymessages
Send us your feedback about the Microsoft Exchange Server 2003 SDK.
Build: June 2007 (2007.618.1)
© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.