Re: Convert MAPI.folder object to Outlook.MAPIFolder object

A

Alex

How do you convert MAPI.folder (CDO) to Outlook folder and vice versa?
Also, does VBScript only recognize Outlook.MAPIFolder object?

Thanks,
Alex
 
S

Sue Mosher [MVP]

The two object models share their EntryID and StoreID properties, so you can use Outlook's Namespace.GetFolderFromID or CDO's Session.GetFolder to get one from the properties of the other.

You can use CDO in VBSCript.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
 
A

Alex

Sue, thanks for the reply.

I have folder structure like

My Folder
Folder 1

Once I have a MAPI.Folder reference (oFolder) to Folder 1, I called

Set folder = gNS.GetFolderFromID(ofolder.FolderID, _
ofolder.StoreID)

But, the folder it returned is "My Folder". Do you know why? How do I get
the "Folder 1"?

Thanks,
Alex

The two object models share their EntryID and StoreID properties, so you can
use Outlook's Namespace.GetFolderFromID or CDO's Session.GetFolder to get
one from the properties of the other.

You can use CDO in VBSCript.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
 
A

Alex

I found out the problem. I should have used ofolder.ID instead of
ofolder.FolderID

Thanks,
Alex

How did you get the MAPI.Folder reference to Folder 1?
 
Joined
Sep 15, 2009
Messages
2
Reaction score
0
conversion fails

hi! i've root of mail folder as imapifolder and i'm trying to get outlook::mapifolder , i get the

PR_ENTRYID,PR_STORE_ENTRYID successfully , but it still fails to get the outlook::mapifolder when i call getfolderfromid , the same thing works normal on outlook2007, and on some outlook2003 as well but on some it just doesn't work at all...there's not one return values, it differs evertime....if anyone have any idea..kindly help me....

 

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