Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Birthday from Outlook Contacts Problem!

Status
Not open for further replies.

TheAceMan1

Programmer
Sep 23, 2003
11,174
US
Howdy All!

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]
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]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
To All . . .

Never mind! According to my library 1-1-4501 is a specific assignment for None! . . . no way around detecting no entry! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top