views:

208

answers:

1

Hi,

I'm retrieving Outlook contacts and would like to find those that have a Birthday defined. When I read a contact that has no Birthday defined, the Birthday property of the ContactItem returns a date in the year 4501, using which I filter the contacts:

if (contact.Birthday.Year != 4501)
{
    ... the contact has a birthday defined, do something ...
}

Naturally I don't feel comfortable with this code. I guess the 4051 relates to some No-Value state either in the DateTime type or in Outlook, however in the DateTime spec I didn't find an "Empty" property or something like that.

Is there another way to know whether an Outlook contact has a Birthday defined?

Thanks

+1  A: 

Yes .. an empty date in outlook is #1/1/4501# test for that and you will be ok .. I know it madness (the next Y2K) :)

76mel
Thanks. Can you quote a formal source with this data? An MSDN article for example?
Bab Yogoo
76mel