Adding a new folder in Outlook through C#

I guess most of us are familiar with Outlook addin’s . Add Ins make our work easier by providing some Out Of Box Features .

In this post we will be looking into how to create a new Folder in the outlook as and when our Plugin starts.


Open a Outlook addin project in your Visual Studio and open the ThisAddIn class.

ThisAddIn_StartUp method will be called every time you starts the plugin or addin.

private void ThisAddIn_Startup(object sender, System.EventArgs e)


Inside startup method call a folder creation method.

private void AddMyNewFolder()

Outlook.Folder folder =Application.Session.GetDefaultFolder(
Outlook.OlDefaultFolders.olFolderOutbox) as Outlook.Folder;
Outlook.Folders folders = folder.Folders;
if (folders.Count == 0)
Outlook.Folder newFolder = folders.Add(“Your Folder Name”, Type.Missing) as Outlook.Folder;
catch (Exception ex)
“Could not add ‘Your Folder Name'”,”Add Folder”,

In the above method you will be seeing that first we have created a parent folder object , in this case the Outbox , and then creating a child folder.

You can set the parent folder by choosing a option from Outlook.OlDefaultFolders .

If instead of a sub folder you want to create a parent folder then in that case manipulate

Outlook.Folders folders = folder.Folders;


Outlook.Folders folders = folder.Parent.Folders;

Plenty of custom functionality can be achieved through addins. Will be coming up with some others.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s