TheAceMan1
Programmer
Howdy All!
I have no problem importing birthdays from outlook using the following code:
The problem arises where no birthday was assigned in OutLook. In OutLook an assignment of [blue]None[/blue] exists where no birthday assignment is made. However when imported, [blue]None[/blue] is converted to [blue]1-1-4501[/blue].
I can easily detect no birthday assignments by comparing for years above say 4000 or equal to 1-1-4501. But this is [blue]logically incorrect[/blue], as 1-1-4501 is a legitimate date!
I'd perfer a more true, logical way to detect [blue]None[/blue]. [blue]Any Ideas? . . .[/blue]
See Ya! . . . . . .
Be sure to see thread181-473997
Also faq181-2886
I have no problem importing birthdays from outlook using the following code:
Code:
[blue]Public Sub test()
Dim olApp As Object, olNameSpace
Dim olContact As Outlook.ContactItem
Dim olFolder As Outlook.MAPIFolder
Set olApp = CreateObject("Outlook.olApplication")
Set olNameSpace = olApp.GetNamespace("MAPI")
Set olFolder = olNameSpace.GetDefaultFolder(olFolderContacts)
For Each olContact In olFolder.Items
With olContact
Debug.Print .[purple][b]Birthday[/b][/purple] & " " & .FileAs
End With
Next
End Sub[/blue]
I can easily detect no birthday assignments by comparing for years above say 4000 or equal to 1-1-4501. But this is [blue]logically incorrect[/blue], as 1-1-4501 is a legitimate date!
I'd perfer a more true, logical way to detect [blue]None[/blue]. [blue]Any Ideas? . . .[/blue]
Be sure to see thread181-473997
Also faq181-2886