Home All Groups Group Topic Archive Search About

avoid syncing birthday date to calendar when saving contact Item

Author
26 Jan 2009 1:20 PM
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
Author
26 Jan 2009 2:15 PM
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


Show quoteHide quote
"Andreas Wöckl" <woe***@esys.at> wrote in message
news:%236T5hj7fJHA.4868@TK2MSFTNGP05.phx.gbl...
> 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
>
>
>
Are all your drivers up to date? click for free checkup

Author
28 Jan 2009 1:01 PM
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

Show quoteHide quote
"Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> schrieb im Newsbeitrag
news:OdkUYC8fJHA.4560@TK2MSFTNGP04.phx.gbl...
> 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
>
>
> "Andreas Wöckl" <woe***@esys.at> wrote in message
> news:%236T5hj7fJHA.4868@TK2MSFTNGP05.phx.gbl...
>> 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
>>
>>
>>
>
Author
28 Jan 2009 2:20 PM
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


Show quoteHide quote
"Andreas Wöckl" <woe***@esys.at> wrote in message
news:Op9GAiUgJHA.1172@TK2MSFTNGP05.phx.gbl...
> 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
Author
2 Feb 2009 7:08 PM
Andreas Wöckl
Hi Ken!

Ok thank you for your help!!

kind regards

Andy
Show quoteHide quote
"Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> schrieb im Newsbeitrag
news:eaj9dOVgJHA.1248@TK2MSFTNGP03.phx.gbl...
>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
>
>
> "Andreas Wöckl" <woe***@esys.at> wrote in message
> news:Op9GAiUgJHA.1172@TK2MSFTNGP05.phx.gbl...
>> 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
>

Bookmark and Share