Outlook 2003 Advanced Search and display results

  • Thread starter Ken Slovak - [MVP - Outlook]
  • Start date
K

Ken Slovak - [MVP - Outlook]

If each instance of an AdvancedSearch that you create has a unique Tag
property you can sink as many SearchComplete events as you need to (although
at some point you will start to create a drag on the server with your saved
MAPI restrictions). In cases like that I would create a class module the
exposes whatever I need to handle the AdvancedSearch methods and instantiate
an instance of the class for each search and then add the class to a wrapper
collection. When the search was done I'd then get the Results collection
from it and kill the class instance that was no longer needed.

I probably wouldn't use and save search folders for that since a persisted
search folder persists the MAPI restriction. I'd most likely use a grid
control to display the results, with hidden columns in the grid used to
store the EntryID and StoreID of the item for each row in the grid. Then
when the grid was double-clicked I'd handle that event and get the EntryID
and StoreID from the row that was double-clicked and use
NameSpace.GetItemFromID(EntryID, StoreID) to get a handle for the item and
open it. The grid control I'd display on a form with whatever other controls
I needed on the form such as command buttons.
 
B

Boaz Raufman

Hi,

I'm trying to use outlook application advancedSearch method to search on
multiple public folders and than
display the results in a convenient view from which the users could double
click on an item to display it.

I encountered several problems in the process:

1) display: I tried using viewctl over a search folder. I used the save
method of the search object to create a
search folder. I followed examples I found in the web and got run time
error -1110425595

My code:

Set objsch = AdvancedSearch(strScope, strF, False, strTag)
objsch.Save ("MySearch")


The only method I could find to display to results was using a list
view, but I could not find a way to enable
displaying the message to the user by clicking the view item.

2) Synchronization: I have created recursive routine for searching public
sub folders. That works but following many
of the web example the search object has to be defined as a global
object in order to access most of it's method
from the Application_AdvancedSearchComplete event routine. Since I have
many advancedSearchs launched
synchronically I can't use a global search object and therefore can't
use those method from Application_AdvancedSearchComplete

Any suggestion and a specily code samples would be helpful.

Thanks,
Boaz

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top