View Single Post
  #4  
Old October 12th 07, 07:30 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Looping through and/or creating Exchange folders via Redemptio

IN RDO that would be either
set Folder =
RDOSession.GetDefaultFolder(olFolderInbox).Parent. Folders.Add("Test Tasks",
olFolderTasks)
or
set Folder = RDOSession.Stores.DefaultStore.IPMRootFolder.Folde rs.Add("Test
Tasks", olFolderTasks)

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

"Mike" wrote in message
...
Yes, based on name, and it seems easy enough I guess even without
Redemption
code, but is it possible to add a folder on the same level as Inbox, i.e.,
att the Namespace level? Something like
Outlook._Namespace.Folders.Add("newfolder", ???) but what Object type to
give it? I've tried it with defaultInbox type, but get a generic
"couldn't
complete the operation" Exception.

Is it even possible to add a folder at that level?

Folders.Add Method:
// TODO: Add code here to start the application.
Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
Outlook.MAPIFolder oTasks =
olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olF olderTasks);
Outlook.Folders oFolders = oTasks.Folders;
Outlook.MAPIFolder oPersonalTasks = oFolders.Add("Personal
Tasks",Outlook.OlDefaultFolders.olFolderTasks);
Console.Write(oPersonalTasks.Name);

"Dmitry Streblechenko" wrote:

Search in what sense? Based on name? Parent? Or...?
In general, you can start with RDOStore.IPMRootFolder (where RDOSrore is
returned by RDOSession.Stores colelection or
RDOSession.Stores.DefaultStore)
and recursively loop through all the subfolders of the RDOFolder.Folders
collection.

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

"Mike" wrote in message
...
I need a way to loop through the folders in the current user's
(Exchange)
mailbox. I will be searching in particular for a folder that I need to
be
there, and if it is not, I need to create it. Is this possible through
the
Redemption objects? If so, can anyone point me towards some sample
code?
Thanks very much.






Ads