private void comboBoxInboxFolders_SelectedIndexChanged(object sender, EventArgs e) { LoadEmailFolderCombo(comboBoxInboxFolders); } private void LoadEmailFolderCombo(ComboBox nbFolders) { OutLook._Application outlookObj = new OutLook.Application(); OutLook.MAPIFolder emailFolder = (OutLook.MAPIFolder) outlookObj.Session.GetDefaultFolder(OutLook.OlDefaultFolders.olFolderInbox); if (!nbFolders.Items.Contains("Default")) { nbFolders.Items.Add("Default"); } foreach (OutLook.MAPIFolder subFolder in emailFolder.Folders) { if (!nbFolders.Items.Contains(subFolder.Name)) { nbFolders.Items.Add(subFolder.Name); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)