Hi, Dmitry, I tried your suggestion, but it not work, the code is almost the
same as i posted before, just make a little change.
Change this:
Outlook::MAPIFolderPtr pDraftFolderPtr = NameSpacePtr-GetDefaultFolder
(Outlook:

lFolderDrafts);
To:
Outlook::MAPIFolderPtr pDraftFolderPtr = ItemPtr-GetParent();
While i Call DeleteMessages(...), it failed with return value: 0x80040106
(Pass in DEL_MESSAGES or HARD_DELETE_MESSAGE flag) and 0x00040680(Pass in 0.).
Dmitry Streblechenko wrote:
What I meant is that the folder that you use to call
IMAPIFolder:
eleteMessages() is always the Drats folder
(NameSpacePtr-GetDefaultFolder(Outlook:
lFolderDrafts); and it is highly
unlikely that the actual parent fodler is Drafts.
.I was simply suggesting to try to use the actual parent folder,.which can
be retrieved from MailItem.Parent.
I'm sorry for reply so lately because of the Chinese New Year. Ok, let's
continue our discuss.
[quoted text clipped - 15 lines]
too, returned the same error.
what's the wrong with my code? please help me.
--
Message posted via
http://www.officekb.com