错误获取Outlook中收件箱子文件夹的名称 [英] error get names of inbox sub folder in outlook

查看:140
本文介绍了错误获取Outlook中收件箱子文件夹的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了以下代码来获取收件箱子文件夹的名称

I wrote following code for get names of inbox sub folder

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);
             }
         }

     }



但它不会提供任何输出,并且正在运行,请告诉我那里是问题..i我正在使用Outlook 12.0对象库



but it wont give any output and it is running pls tell me wht is the issue there ..i am using outlook 12.0 object library

推荐答案

您要支付多少? Code Project中的好人一步一步地完成了您的项目? :-D
How much are you paying the nice people here at Code Project who have, piece by piece, completed your project? :-D


这篇关于错误获取Outlook中收件箱子文件夹的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆