Friday, 20 November 2009

Hoax emails

Why do people continue to forward e-mails that claim the end of the world is nigh?
It seems to be almost a daily occurance now to receive an email asking you to forward it on to everyone you know as the worst virus ever is on its way and nobody knows how to get ride of it.

A simple Google of the headline of the story will soon tell you that it is a hoax!

Wednesday, 14 October 2009

VSTO and Due Dates on Tasks

You'd think that when you create a task that can have a blank due date, it would actually be blank now wouldn't you! Well, this isn't the case!
If you create a task and don't set a due date, the due date is actually set to 1/1/4501! This seems to be a magic date as other values (like DateTime.MaxValue) are shown literally.
This becomes a little cumbersome when you want to store the fact elsewhere.

Wednesday, 7 October 2009

VSTO and Contacts

I'm spending an amount of time looking at integrating our application into Outlook at the moment.

To give some background, I want to take the collection of contacts out of our database and put them into an Outlook Contact List - this is fine and easily done.
In fact there's a reasonable description of what is required here

What I then want to do is to make a note into our application when you send an email to one of these contacts; well that's pretty easy - or is it?

Attaching to the Application.ItemSend event is great, this tells us when we're about to send a message. From here, we can get the recipients of the message - that's fine.
We then need to get hold of the contact to see if it is one of our imported contacts.; well the recipient class has an AddressEntry property that has a GetContact method on it.

You'd think this would do the job for us now wouldn't you!
Well, it's like this...
If the contact is in a folder with the property set to be included in the address book, then yes, you can get at your imported contact. If the folder doesn't have this property set, then you don't!

I've spent a good few hours trying to track this down and the hint was on here as it says that it only returns the Contact in the address book.

Ho hum, it would be nice if this wasn't quite so obtuse, but there you go.