The IMsgStore::SetReceiveFolder method establishes a folder as the destination for incoming messages of a particular message class.
HRESULT SetReceiveFolder(
LPTSTR lpszMessageClass,
ULONG ulFlags,
ULONG cbEntryID,
LPENTRYID lpEntryID
);
The IMsgStore::SetReceiveFolder method sets or changes the receive folder for a particular message class. With SetReceiveFolder, a client can, by using successive calls, specify a different receive folder for each message class defined or specify that incoming messages for multiple message classes all go to the same folder. A client can, for example, have its own class of messages arrive in its own folder. For instance, a fax application can designate a folder where the store provider places incoming faxes and one where the provider places outgoing faxes.
If an error occurs while calling SetReceiveFolder, the receive folder setting remains unchanged.
If SetReceiveFolder changes the receive folder setting with lpEntryID set to NULL, indicating the default receive folder should be set, SetReceiveFolder returns S_OK even if there was no existing setting for the indicated message class.