Hi,
I want to retrieve all items from outlook inbox that has one or more attachments.
My current code is:
But the restrict statement is not working. Is anyone here how to do it?
Thanks.
I want to retrieve all items from outlook inbox that has one or more attachments.
My current code is:
Code:
Outlook.Application objO = new Outlook.Application(); Outlook.NameSpace objNS = objO.GetNamespace("mapi"); objNS.Logon("profilename", "password", false, true); Outlook.MAPIFolder folderInbox = objNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox); Outlook.Items inboxItems = folderInbox.Items; inboxItems = inboxItems.Restrict("Count([Attachments]) > 0");
Thanks.