Monthly Archives: January 2008

Search e-mail at lightspeed: using Lookout with Outlook 2007

Everybody who uses Microsoft Outlook must know that Outlook’s search functionality sucks. Yes, I know that’s a bold statement, but there’s no other way to say it. Outlook search sucks big time, period! Even Joel agrees… My mailbox is growing every day and I find it harder and harder to keep track of its contents. A search through my archived folders often takes a much as a full minute of searching, which I find unacceptable. In the press I often read Microsoft Corporation finds Search important and lately we’ve seen them release some impressive search products (i.e. Search Server 2008 and Search Server 2008 Express). Also a major part of my daily job involves implementing SharePoint 2007 solutions at our customers, which most of the time also includes SharePoint’s search feature. But somehow the Outlook team seems to have missed the boat…

Some years ago a guy called Mike Belshe created a great free Outlook add-in called Lookout, that offered a lightning fast search. Within seconds of starting a search (often even within a second!) the results would appear on screen. Microsoft was quick to buy his company and its technology. At that time many people expected Microsoft to integrate Lookout into Outlook, but unfortunately they seem to have shelved it (Mike himself claims some of his Lookout code ended up in Windows Desktop Search). So now there’s no official way to obtain Lookout. Luckily there are many sites that still offer the Lookout download. A quick search on Google should point you to some sites containing working download links.

However, getting Lookout to work with Outlook 2007 is more problematic. It turns out that Lookout checks for specific Office Primary Interop Assemblies (PIAs) and the PIAs that come with Outlook 2007 don’t pass this test. The result is that Lookout prevents itself from running under Outlook 2007 and instead displays this warning message:

Lookout error message

After much demand Mike Belshe published a way to get Lookout to work with Outlook 2007. For this you have to rename an Office PIA file, which resides in the Global Assembly Cache. While this solution gets Lookout to work, it may have serious impact on other applications/add-ins that make use of this PIA. So this solution isn’t acceptable for me (and it shouldn’t be for you!).

Instead I opted for a different approach. The only reason that Lookout doesn’t run on Outlook 2007 is that dreaded PIA check. So why not remove it? Which is exactly what I did…

A quick Reflector session revealed that the code that performs the PIA check is located inside the assembly named Inventures_Olk.dll and goes by the name of CheckOutlookInterop(). What it does is compare the installed Office PIA’s name to a built-in string constant. If the match is positive it returns the boolean value true, otherwise it returns false. Using ILDASM I decompiled the assembly to CIL, changed CheckOutlookInterop()‘s code to always return true and recompiled the assembly. So that gave me a fully working Lookout version that’s compatible with Outlook 2007!

You can download the patched assembly here. Just replace the the original Inventures_Olk.dll with the patched version and you should be searching your Outlook 2007 content a lightspeed in no time…

Oh yeah, there’s one small issue… It seems Lookout crashes while indexing if you run it on Vista. Bummer…

Update: Recently I discovered there’s another bug in Lookout that causes dates to be parsed incorrectly if you have the .NET Framework 2.0 installed. You can read more about it here. Fortunately someone has fixed this problem and also released a patched DLL that you can download.

Update 2: The DLL I patched and offer on this blog should work with Lookout version 1.3.0.24057. But as I understand that version of Lookout crashes during indexing on Vista and Windows 7. In the comments below user Stroth claims he got my patched DLL working with an older version of Lookout, a version that also works with Vista and Windows 7 and doesn’t crash. That’s good news, however I never tested that.