|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
avoid syncing birthday date to calendar when saving contact ItemI 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 Either don't set a birthday or anniversary value or find the newly created
calendar entries and delete them. -- Show quoteHide quoteKen 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 > > > 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 >> >> >> > 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. -- Show quoteHide quoteKen 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 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 >
Other interesting topics
Working with Outlook Contacts from Access
outlook 2003 sometimes turns off rule Running an Excel macro via Outlook reminder Outlook confirmation dialog. Add internet header in Outgoing email? Sample Code Moving messages from inbox Custom Pane/Custom Interface Linking Access To Outlook Attachment Problem How to have multiple macros with shared event handlers? |
|||||||||||||||||||||||