digital Infuzion
DIFZ Blogs Home Contact Us Site Map Employee Login
About Us Industries Services Contracting Vehicles Publications

 
DIFZ Blogs
 
DIFZ Blogs : Outlook Contacts Gadget
Outlook Contacts Gadget
My boss, Hemant, came into my office one day and said, “Tom, I wish there was a Gadget that would let me retrieve information from my Outlook Contacts, so that when I need a clients phone number I could just look it up, without going through all my Contacts in Outlook, or switching from my email.”

I thought to myself, there should definitely be one available, that Microsoft built, to do this.  But all I could find was an Inbox, Appointment and some gadget that looked up information from Windows Vista Contacts (Who uses that anyway?).  I could not find one that would search into Outlook Contacts and retrieve me the information my boss was looking for, so I had to make my own.

I am not going to walk you through how Gadgets are built, there are many fine examples of this on the web, and in my references below, but I am going to give you the highlights on what technologies I used to architect this Gadget.  I am also going to provide this Gadget, so that you can dissect it, learn from it and use it in your own solutions.

The basic requirements for this Contacts Gadget are as follows:

  1. Provide an input box that would let the user type in a contacts name.
  2. This input box should automatically list all users from outlook and filter as the user types.
  3. Once the user selects a contact, the gadget should retrieve the phone contact information from Outlook.
  4. In addition to this, the Gadget should remember the history of the last three contacts retrieved by the user.
  5. The History should scroll down the Gadget, so the most recent search is on the top and as the max contacts are retrieved the oldest retrieved contact will scroll off the screen.
  6. Because there is not a lot of room to display information, in this gadget we are only displaying phone contact information,  there should be a Fly-Out that should display all of the Outlook’s Contact information (Addresses, Contact mechanisms, Email, etc)
  7. This Gadget should be able to be used on any computer and not restricted to in the office use.

To build this Gadget, I used several code snippets and examples, which are listed below:

  • The first component is a JavaScript Auto-complete Textbox – This code I got from the Code Project and its reference is below.  This allows me to meet requirements #1 and #2 above.  Since Gadgets are basically web pages, the best way to provide interactive content is to use JavaScript.  This is a nice JavaScript auto-complete textbox that is easy to use and has nice features for filtering on key commands.
    jsactb
  • The second component is a .NET Interop for Gadgets assembly – This code, I also got from the Code Project and is reference below.  This component allows you to write code in .NET and let you call it through JavaScript.  Since Gadgets are simple web pages, they cannot natively use compiled .NET code, you must provide an Interop layer, so that the JavaScript can call out to a Com component.  Since I needed to work with Outlook and retrieve information from Exchange, I wanted to use .NET to write this code.  I find that using .NET to write this code is easier than straight JavaScript.  That is where this component and example comes into play.
    GadgetInterop
  • The third and final component is to use WebDAV.  This allows you to query Microsoft Exchange by using similar technology as Outlook Web Access (OWA).  I used several examples from the web to learn how to do this and this allowed me to meet requirements #3 and #6 above.  These references are listed below.
    exchange_webdav_examples
    aa123736.aspx
  • The rest of the code was taken from examples and walkthroughs on how to build Gadgets.  This allowed me to meet the remander of the requirements listed above.  Below is a great link for building Gadgets.
    ms723694.aspx

As you can see in the pictures below, the gadget is fairly basic, but provides a good example of how to build Gadgets using Visual Studio .NET as well as integrate with the Exchange Store (Outlook Web Access).  I hope that you found this Blog useful, and as always, I welcome your comments.

To download the gadget and source, click on the links below.

Outlook Contact Gadget (after download, strip the .zip from the file and install)
Outlook Contact Gadget c# Source Code

Gadget Selector
This image above shows the Gadget Selector screen. This is where you can drag and drop the Outlook Contact Gadget onto the SideBar
Gadget Settings
The image above is used to set the settings for the gadget. This is accessed by hovering over the gadget, once it is on the sidebar, and clicking on the little wrench icon.  There are 4 settings that must be set:
  1. UserID - This is your domain user id used to log you into Outlook Web Access (OWA)
  2. Password - This is your domain account password
  3. Domain - This is the domain your user id and password needs to be validated against
  4. Outlook Web Access URL - this is the OWA url. This can be and is usually https://smtp....
Gadget Main Picture
The image on the left shows the gadgets dynamic drop down list. This list is pulled from your OWA contacts. As you type, it filters the list automatically. You can also use the arrow keys and mouse to select a persons name.
 
The image on the right shows the gadget after selecting 3 different contacts. This list will be rolling, so as you select another user the last user in the list will fall off.
Gadget Main Picture
What the below image shows is the Gadget Flyout Window. This dialog gives you additional details on the contact selected from the main screen. You can get to this by simply clicking, underneath the contacts name in the main gadget (On the phone numbers ).
Gadget Flyout Picture

hi,

i downloaded the zip... no install file? Please help?
Comment By At 10/15/2007 5:21 PM
To install, download the file. Rename the download file by removing the.zip from the end. Then simply double click on the OWAContactGadget.gadget file. This will only work on Vista operating systems.
Comment By DIFZ Blogs At 10/15/2007 5:42 PM
Sorry, i kow i am stupid at this...

When io click the file, .gadget, it just opens the folder and shows me ALL the files.

Clicking these just takes me to IE and shows me code?

I am sorry, please help.
Comment By At 10/16/2007 5:18 AM
Sorry, i kow i am stupid at this...

When io click the file, .gadget, it just opens the folder and shows me ALL the files.

Clicking these just takes me to IE and shows me code?

I am sorry, please help.
Comment By At 10/16/2007 5:19 AM
Hehehe...

Came right thanks!

Nice gadget... got to make it work now.

But atleast it is in sidebar!

THANKS
Comment By At 10/16/2007 5:28 AM
This only works for Outlook web access? Could you make it work for ordinary outlook (you know, the kind that runs on your desktop vs through a browser).
Comment By At 10/18/2007 12:50 PM
Unfortunatly this is the way it works, because you don't want to be dependent on Outlook running on the client, or doing interop to the office DLL. This service is easier and more stable by using the OWA Web Services.
Comment By At 10/19/2007 5:19 PM
Great Post
Comment By At 12/2/2007 8:52 AM
I can get the gadget to install just fine buy it doesn't pull any contacts. I've verified the username, passord, and OWA url several time will the same result. It acks as if all is well but when I try and search for a contact it does not return any answers.
Comment By At 2/25/2008 4:06 PM
When I first saw the Contacts gadget for Vista I couldn't believe it wouldn't pull in the contacts data from Outlook - typical Microsoft ! I like you have spent ages researching this and got nowhere. Can you clarify the reasoning behind not setting this up to work with a normal running Outlook client rather than OWA ?

Nice job anyway.
Ian
Comment By At 4/14/2008 4:06 PM
The reason you need to use OWA is because OWA contains Web Services that allow you to retrieve the Outlook data from anywhere. You can not use Gadgets to execute client side APIs, such as automating Outlook, due to security reasons. Also OWA is accesable anywhere, so you can install the Gadget on another computer where you don't have Outlook set up and you can still get your contacts.
Comment By At 4/17/2008 8:59 AM
There's an easier to use one here (http://enterpriseadblock.com/outlookcontactsgadget/). Sadly it's not free like yours.
Comment By At 11/14/2008 12:43 AM
Hi,

I installed the gadget and I configure it but it does not seems to work. It doe not remember mine Outlook Web access url:
I tried several options:
https://example.domain.com/ and https://example.domain.com/exchange

any idea what i am doing wrong.
Comment By At 1/28/2009 5:28 AM
Now...if this could be integrated with Windows Fax and Scan, that would be dope!

The reason I say this is that x64 Vista (and Windows 7) will not allow Windows Fax and Scan to pull up Outlook Contacts.
Comment By At 6/24/2010 9:38 AM
Comments :
       
Comments :
Enter the code shown:

 
Allowed Tags : <A>, <B>, <I>, <BLOCKQUOTE>


 
 
 Copyright © 1999-2009 Digital Infuzion, Inc. All Rights Reserved.