在两个日期之间搜索outlook sentitems [英] Search outlook sentitems between two dates

查看:141
本文介绍了在两个日期之间搜索outlook sentitems的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DateTime preDate = TodayDate.AddDays(-3);
                        string filter1 = "[Start] >= '" +preDate.ToString("g",
           CultureInfo.CurrentCulture) + "' AND [End] <= '" + TodayDate.ToString("g",
           CultureInfo.CurrentCulture) + "'";
                        oItems.IncludeRecurrences = true;
                        oItems.Sort("[Start]", Type.Missing);
                        oItems = oItems.Find(filter1);
                        
                       int total= oItems.Count; 

我收到0件物品



在我的展望中我也有物品。



如何获得outlook发送项目b / w两个日期。



请帮助我。

i am getting 0 items

In my outlook i have the items also.

how to get outlook sentitems b/w two dates.

pls help me.

推荐答案

- 已解决 -

--Solved--
Outlook._NameSpace olNs;
Outlook.MAPIFolder oSents;
Outlook.Items oItems;
olNs = olApp.GetNamespace("MAPI");
oSents = olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
oItems = oSents.Items;




DateTime fromDate= Convert.ToDateTime("11/21/2013");




DateTime toDate= Convert.ToDateTime("11/28/2013")




oItems = oSents.Items.Restrict("[ReceivedTime]>'" + fromDate + "' AND [ReceivedTime]<'" + toDate+ "'");


这篇关于在两个日期之间搜索outlook sentitems的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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