C# 对Outlook2010进行二次开发
第一步:添加新项目
第二步:添加新的页签,注意,此页签是显示到Outlook主界面的
第三步:添加自己想要的文本框以及按钮
第四步:如果你想将此界面显示到主界面的话,需要这样设置:属性里面的RibbonType 设置为 Microsoft.Outlook.Explorer
运行后的结果:
获取所有邮件内容
Microsoft.Office.Interop.Outlook.Application app; Microsoft.Office.Interop.Outlook.Items items; Microsoft.Office.Interop.Outlook.NameSpace ns; Microsoft.Office.Interop.Outlook.MAPIFolder inbox; Microsoft.Office.Interop.Outlook.Application application = new Microsoft.Office.Interop.Outlook.Application(); app = application; ns = application.Session; inbox = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox); items = inbox.Items; foreach (var item in items) { var mail = item as Microsoft.Office.Interop.Outlook.MailItem; if (mail != null) { if (mail.UnRead == false) { Globals.Ribbons.Ribbon1.txtHwabInfo.Text = mail.SenderEmailAddress; } } }
谢谢大家!!
相关推荐
TyrionZK 2020-07-26
BeanJoy 2020-07-04
xjp 2020-06-28
BigCowPeking 2020-06-28
Kakoola 2020-05-10
xjp 2020-04-16
BillyThe 2019-08-25
jsjbkshz0 2019-02-19
jetamiett 2019-08-23
crazyhulu 2014-09-29
shimly00 2019-02-19
laotumingke 2011-05-03
84510294 2014-09-24
weita 2013-10-06
Crazyshark 2011-10-16
bingkingboy 2019-04-25
xhgWanderingsoul 2018-12-17
japson 2014-01-28
半生不熟 2016-12-20