Click here to Skip to main content
11,713,845 members (86,668 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 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
Edited 12-Jun-10 23:52pm
Henry Minute224.6K
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
0 Sergey Alexandrovich Kryukov 370
1 CHill60 250
2 Maciej Los 229
3 Richard MacCutchan 210
4 OriginalGriff 175
0 Sergey Alexandrovich Kryukov 365
1 CHill60 335
2 OriginalGriff 245
3 Andy Lanng 173
4 Richard MacCutchan 150


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 13 Jun 2010
Copyright © CodeProject, 1999-2015
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