Discussion:
avoid syncing birthday date to calendar when saving contact Item
(too old to reply)
Andreas Wöckl
2009-01-26 13:20:37 UTC
Permalink
Hi Group!

I am syncing my contacts from an sql server database to a public folder with
VBA. I am using the following code (snippet)

With myItem
.OrganizationalIDNumber = myId
.Birthday = myBirthday
...
.save

End With

The problem is that the user that executes this code gets a calendar entry
with the birthday date of this user in his private calendar. This would not
be bad, but every sync mechanism (perhaps a telephone number changes) causes
Outlook to create a NEW entry in the calendar..

Anyone an idea how to prevent Outlook from doing so?

Kind regards

Andy
Ken Slovak - [MVP - Outlook]
2009-01-26 14:15:42 UTC
Permalink
Either don't set a birthday or anniversary value or find the newly created
calendar entries and delete them.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by Andreas Wöckl
Hi Group!
I am syncing my contacts from an sql server database to a public folder
with VBA. I am using the following code (snippet)
With myItem
.OrganizationalIDNumber = myId
.Birthday = myBirthday
...
.save
End With
The problem is that the user that executes this code gets a calendar entry
with the birthday date of this user in his private calendar. This would
not be bad, but every sync mechanism (perhaps a telephone number changes)
causes Outlook to create a NEW entry in the calendar..
Anyone an idea how to prevent Outlook from doing so?
Kind regards
Andy
Andreas Wöckl
2009-01-28 13:01:10 UTC
Permalink
Hi Ken!

I have to set the birthday values - no way without it :(.

Do you have some example code to find the "newest" value in the private
calendar to delete? Perhaps with an ID?

Kind regards

Andy
Post by Ken Slovak - [MVP - Outlook]
Either don't set a birthday or anniversary value or find the newly created
calendar entries and delete them.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by Andreas Wöckl
Hi Group!
I am syncing my contacts from an sql server database to a public folder
with VBA. I am using the following code (snippet)
With myItem
.OrganizationalIDNumber = myId
.Birthday = myBirthday
...
.save
End With
The problem is that the user that executes this code gets a calendar
entry with the birthday date of this user in his private calendar. This
would not be bad, but every sync mechanism (perhaps a telephone number
changes) causes Outlook to create a NEW entry in the calendar..
Anyone an idea how to prevent Outlook from doing so?
Kind regards
Andy
Ken Slovak - [MVP - Outlook]
2009-01-28 14:20:41 UTC
Permalink
I don't have sample code for something like this but the algorithm is pretty
simple.

Get the date/time you add the birthday/anniversary to the contact. Get the
ContactItem. Filter the Calendar.Items collection for items modified or
created at or after the date/time you added the information to the contact.
Check each returned calendar item for its Links collection and see if any
Link object matches the contact information. A Link can only be a
ContactItem. Check the FullName and any other distinguishing properties to
make sure you have the match.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by Andreas Wöckl
Hi Ken!
I have to set the birthday values - no way without it :(.
Do you have some example code to find the "newest" value in the private
calendar to delete? Perhaps with an ID?
Kind regards
Andy
Andreas Wöckl
2009-02-02 19:08:09 UTC
Permalink
Hi Ken!

Ok thank you for your help!!

kind regards

Andy
Post by Ken Slovak - [MVP - Outlook]
I don't have sample code for something like this but the algorithm is
pretty simple.
Get the date/time you add the birthday/anniversary to the contact. Get the
ContactItem. Filter the Calendar.Items collection for items modified or
created at or after the date/time you added the information to the
contact. Check each returned calendar item for its Links collection and
see if any Link object matches the contact information. A Link can only be
a ContactItem. Check the FullName and any other distinguishing properties
to make sure you have the match.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by Andreas Wöckl
Hi Ken!
I have to set the birthday values - no way without it :(.
Do you have some example code to find the "newest" value in the private
calendar to delete? Perhaps with an ID?
Kind regards
Andy
Loading...