Click here to Skip to main content
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 19:54pm
Edited 13-Jun-10 0:52am
Henry Minute223.9K
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 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 Zoltán Zörgő 99
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 13 Jun 2010
Copyright © CodeProject, 1999-2014
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