Search Top Level Folders in Outlook
Posted on 2002-03-11
I am using the Microsoft Outlook 10.0 object library to access Outlook. For some reason I am able to use the Folder.Find method on any sub-folder and provided there is mail that meets the search criteria, this mail is returned by the method and can be manipulated.
If I initialise a folder object to the Inbox, and attempt to use the .Find method, I never get a result. Does the .Find method work on the Inbox? Is there something particular to the Inbox that needs to be done in order for .Find to work?
My code looks similar to what follows:
set fldInbox = NS.GetDefaultFolder(olFolderInbox)
set MSG = fldInbox.Items.Find(sCriteria)
set MSG = fldInbox.Find(sCriteria)
MSG.Display '''err is Object Variable not set '91'