Redemption Foldes.Add doesn't work

E

escamoteur

I tried this here. The Store is created, fine, but the folder is not created although the returned RDOFolder is not null

I use Outlook 2007

RDOSession Session = new RDOSessionClass();// CreateObject("Redemption.RDOSession");
//Use the MAPI session from Outlook Object Model
Session.MAPIOBJECT = theApp.Instance.Application.Session.MAPIOBJECT;
RDOStore Store = (RDOStore) Session.Stores.AddPSTStore(path, 2, "ArtistsOrganizer");
RDOFolder folder = Store.RootFolder.Folders.Add("Opportunities", "IPM.Task.ArtistsOrganizer.BO");
 
D

Dmitry Streblechenko

REplace the line
RDOFolder folder = Store.RootFolder.Folders.Add("Opportunities",
"IPM.Task.ArtistsOrganizer.BO");
with
RDOFolder folder = Store.IPMRootFolder.Folders.Add("Opportunities",
"IPM.Task.ArtistsOrganizer.BO");

Note that root folder of any store is not visible - Outlook creates
invisible and search folders there.
What you need is the root IPM folder (which is a subfolder of the root
folder).
You can look at the folders in OutlookSpy - click IMsgStore button in the
OutlookSpy toolbar, then click "Open Root Container" and go to the
GetHierarchyTable tab.

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

escamoteur

Does the GetRootFolder Method of OOM return in reality the IPMRootFolder?

Because this here was my former code

theApp.Instance.Application.Session.AddStoreEx(,Microsoft.Office.Interop.Outlook.OlStoreType.olStoreUnicode);
Outlook.MAPIFolder rootFolder = (Outlook.Folder) AO_Store.GetRootFolder();
rootFolder.Name = ;
//Create Folders
BO_Folder = (Outlook.Folder)rootFolder.Folders.Add("Oportunities", Outlook.OlDefaultFolders.olFolderTasks);

And that worked
 
D

Dmitry Streblechenko

Yes, Store.GetRotFolder returns the IPM root folder, not the topmost folder
in the store.

--
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