//namespace Add(Microsoft.Office.Interop.Outlook.dll)
using Outlook = Microsoft.Office.Interop.Outlook;
//code
private void SearchInOutlook() { if (Application.Session.DefaultStore.IsInstantSearchEnabled) { Outlook.Explorer explorer = Application.Explorers.Add( Application.Session.GetDefaultFolder( Outlook.OlDefaultFolders.olFolderInbox) as Outlook.Folder, Outlook.OlFolderDisplayMode.olFolderDisplayNormal);
//this will search for subject.
string filter = "subject:" + "\"" + "Office 2007" + "\"" + " received:(last month)"; explorer.Search(filter, Outlook.OlSearchScope.olSearchScopeAllFolders); explorer.Display(); } }
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......