Getting EntryID After Moving Item

D

Dan Johnson

We're using VB6 code similar to the following to copy an Outlook item to a
folder:

Set myItem = myolApp.CreateItem(olMailItem)
Set myCopiedItem = myItem.Copy
myCopiedItem.Move myNewFolder

Is there any way to get the EntryID of the myCopiedItem object in
myNewFolder without having to close myCopiedItem, then iterate through all
of the items in myNewFolder until we find it? We've tried saving
myCopiedItem (gives same EntryID before and after Save, but then later
changes the EntryID after closing).

Thanks for any feedback!

Dan
 
S

Sue Mosher [MVP-Outlook]

Try:

Set myMovedItem = myCopiedItem.Move(myNewFolder)
MsgBox myMOvedItem.EntryID
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
D

Dmitry Streblechenko

Move is a function, not a sub:

set myCopiedItem = myCopiedItem.Move(myNewFolder)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top