View Single Post
  #4  
Old June 30th 07, 07:10 AM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default AdvancedSearchComplete event handler

The alternative I was suggesting does involve an installation package (or at
least registering a .dll) on every PC that needs to run your web application.
So if you don't have control over your "audience", this may not work unless
they choose to download and install your software first.

If you can proceed, essentially code your logic in a .dll as if it's running
on that user's PC. But design it with the expectation that the other code
you write in your web app is going to call this client-side code, which is
essentially your "wrapper library". So your web app would do something like:

Dim myLib, myResults

Set myLib = CreateObject("MyCustomLibrary.SearchUtility")
myResults = myLib.SearchOutlook("search keyword")

Then this will load the .dll installed on the user's computer and run the
full Outlook Object Model code you wrote that uses Outlook objects, with the
appropriate events being handled there.

So in the .dll, you'd have a SearchUtility.cls file, with a SearchOutlook
function:

Function SearchOutlook(SearchString As String) As Collection

'This function could return another object - depending on how you want the
search results and what you want to do with them

'write code to search Outlook - another event not shown will be the
AdvancedSearchComplete event code

'get the results, pass it to the Function caller

SearchOutlook = whatever

End Function

Hopefully this turns on a few lightbulbs!


--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"nana" wrote:

Dear Eric,
Thanks for your reply. A bit disappointed though (not because of you, but
the fact that outlook allows script language to access the outlook object and
perform search but not returning the events).
Well... I need it on a web application so VBA marcros is not an option for
me.
Do you have any sample how the rest of your suggestions could be achieved?
Thanks


"Eric Legault [MVP - Outlook]" wrote:

Outlook object events are not available to scripting languages. You will
need to call a client-side .dll that implements the required Outlook objects,
or redo your solution to use the Outlook Object Model via VBA macros, a
custom COM app, or a COM Add-In.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"nana" wrote:

Hello MVPs, hello everyone,
I am trying to write me eventhandler to catch the event
AdvancedSearchComplete.
SCRIPT FOR="Outlook" EVENT="AdvancedSearchComplete()" language='vbscript'
alert("search is completed");
/script
But some how this alert has never come up. Any idea?
Or do you have another way to catch the event?


Regards,
Hena

Ads