Currently im using C# and Microsoft.Office.Interop.Outlook to access my email, i want to filter the mesagges with current date, however the restriction is only retrieving some emails and not all of them, whats wrong with the restriction? This is my code:
Microsoft.Office.Interop.Outlook.NameSpace ns = oApp.GetNamespace("MAPI");
DateTime current = DateTime.Now;
String filter = "";
var f =ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
var items = f.Items;
filter = " [ReceivedTime] >= " + "'"+current.ToString("d")+"'";//Filter
var filteredFolder = items.Restrict(filter);
Console.WriteLine("Emails from today: " + filteredFolder.Count);
That last line is printing only 2 when i have received 5 emails today.
Thanks!