Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

_MailItem::Move fails with MAPI_E_NOT_FOUND

Skip to first unread message

tnem...@googlemail.com

unread,
Jun 9, 2009, 9:05:50 AM6/9/09
to
During many days of testing of my Outlook add-in I came across an
interesting problem:

Every now and then my call to _MailItem::Move fails. I have no idea
why that is. I only observed that in such situations the Move
operation acts as a copy and it returns a failure status.
See below:

void MoveItem(CComPtr <Outlook::_MailItem> mi, CComPtr <MAPIFolder>
newfolder)
{
HRESULT hr;
CComPtr <IDispatch> ReturnedItem;

hr = mi->Move(newfolder, &ReturnedItem);
if( FAILED( hr ))
{
//here ReturnedItem == 0x00000000 although I can see that
the item *EXISTS* in the new folder
}
// ... more code ...

}

Although the new instance of the item exists, the old one was not
deleted. Despite this the ReturnedItem (ie. the new instance == 0)

Does anyone else have more experience with this issue? I would like to
know more about what can cause this, how to prevent this from
happening. If there is no way to do this then I suppose I only have to
mitigate the impact of this happening.

The hr contains 8004010F (MAPI_E_NOT_FOUND) if the call fails.


P.S: I tried to google it and found that Redemption in one of its
earlier versions also had similar looking bug. Don't know it this
might be related or not or if it can shed some light on what is
happening behind the scenes.

Dmitry Streblechenko

unread,
Jun 9, 2009, 10:53:47 AM6/9/09
to
What kind of mesage store is it?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
<tnem...@googlemail.com> wrote in message
news:be6d27b3-1f54-4b40...@n21g2000vba.googlegroups.com...

Message has been deleted

tnem...@googlemail.com

unread,
Jun 10, 2009, 4:05:58 AM6/10/09
to
It is a PST store for email messages from an IMAP server account. Also
have you seen my other question regarding RDOMail.Move and the
subsequent inability to access the destination mail item's EntryId?
Many thanks for your suggestions.

Dmitry Streblechenko

unread,
Jun 14, 2009, 4:06:05 PM6/14/09
to
In case of Redemption it probably fails because it cannot find the new
message by the value of the PR_SEARCH_KEY, which is supposde to come from
the original message, I would imagine OOM has the same problem..

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
<tnem...@googlemail.com> wrote in message

news:4c5161b3-0c7b-46b1...@j18g2000yql.googlegroups.com...

0 new messages