problems accessing non-default folders

P

Paulos

I am trying to make improvements to an app I wrote a while back in C#.

What I want to do is to move an email message from the Inbox to another
folder within the inbox that I have created called 'JS Archive'.


NameSpace objOLNS = objOL.GetNamespace("MAPI");
MAPIFolder objInbox =
objOLNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);

The above code gives me access to the inbox but I cannot figure out how
I get access to folders that I create (i.e. not one of the default folders)

Anyone out there know how this is done?

Secondly, anyone know how to move an email from one folder to another in
code.

If anyone out there knows how to do this stuff in VBA but not in C# I
can probably translate it ;)

Cheers

Paul BJ
 
D

Dmitry Streblechenko

You can access no-default folders using Namespace.Folders collection
(returns all top level folders).
To access subfolders of a given folder, use MAPIFolder.Folders collection.
Note that you can use either an integer index (1 to Count) or the subfolder
name).

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