Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,
To get items from sent items of outlook i have written like this..

C#
string restrictCriteria = "[Start]='08/30/2012'";
oItems = oItems.Restrict(restrictCriteria);


no error but i am not getting any items on that date, Can i change date format like oulook date format.How to know outlook date format?
Posted

1 solution

Solution

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

                            DateTime dateTime = Convert.ToDateTime("11/25/2013");

                            oItems = oSents.Items.Restrict("[ReceivedTime]='" + dateTime);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900