Click here to Skip to main content
12,394,978 members (67,386 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#3.0 C# Outlook
need c# code for show inbox sub folders in button click

i already created the code for create sub folders inside the inbox folder
it is as follows

private void btnSave_Click(object sender, EventArgs e)
       {
           if (string.IsNullOrEmpty(txtSave.Text.Trim().ToString()))
           {
               MessageBox.Show("Enter name");
               return;
           }
           else
           {
               CreateInboxFolder();
 
           }
 

 

 
       }
 
       private void CreateInboxFolder()
       {
 
           try
           {
           string folderName = txtSave.Text.ToString();
           OutLook._Application olApp = new OutLook.ApplicationClass();
           OutLook._NameSpace olNs = olApp.GetNamespace("MAPI");
           OutLook.MAPIFolder oInbox = olNs.GetDefaultFolder(OutLook.OlDefaultFolders.olFolderInbox);
           OutLook.Folders oFolders = oInbox.Folders;
           OutLook.MAPIFolder oInboxFolders = oFolders.Add(folderName, OutLook.OlDefaultFolders.olFolderInbox);
           MessageBox.Show("Folder " + oInboxFolders.Name + " is Created");
           }
           catch (Exception)
           {
 
               MessageBox.Show(txtSave.Text + " folder already created please enter differetnt name");
               txtSave.Focus();
           }
 

 

       }

pls tell me how to do it ... i was struck at that point in my project Confused | :confused: Confused | :confused:
Posted 12-Jun-10 18:54pm
Updated 12-Jun-10 23:52pm
Henry Minute225.2K
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

See here.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 13 Jun 2010
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100