Hi,
I found this piece of code on the web.
http://help.lockergnome.com/office/C...ct1002097.html
Its purpose is to send a short greeting to every contact if his/her Birthday falls within today.
The problematic line is: BD = oCurItem.Birthday
(I added it to see the birthday date by placing the curson on it)
After 2-3 Loop cycles I get a 438 error: "...does not support this property" and BD shows: 01/01/4501
What did I do wrong ?
Sub getContacts()
Dim olns As Outlook.NameSpace
Dim oConItems As Outlook.Items
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set oConItems = olns.GetDefaultFolder(olFolderContacts).Items
Flag = 0
For Each oCurItem In oConItems
BD = oCurItem.Birthday ''''''''''''' ???
If oCurItem.Birthday = Date Then
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
msg.Subject = "Happy Birthday"
msg.Address = objContactItem.Email1Address
msg.Display
Set msg = Nothing
Flag = Flag + 1
End If
Next
If Flag = 0 Then MsgBox "No Birthdays Today"
End Sub
Thanks,
Elm
Bookmarks