PDA

View Full Version : Deleting old calendar events when importing new ones



victoria6148
12-07-2010, 08:29 AM
Hello,

I am importing a CSV file into the Outlook Calendar to insert new appointments from an SQL database. The import happens every couple of hours since the appointments in the SQL database might change or be cancelled. One problem that has arisen is that when an appointment is cancelled or moved to a new time and the next import happens, the old appointment in Outlook does not get deleted. I was wondering if there is way to delete these old appointments when the import update happens? Possibly with a macro that runs when the import happens? Thank you for all of your help!

Benzadeus
12-11-2010, 05:47 AM
One problem that has arisen is that when an appointment is cancelled or moved to a new time and the next import happens, the old appointment in Outlook does not get deleted.

Pretty hard here. Just two questions:
1 - How do you know that an appointment was cancelled?
2 - How do you know that an appointment's time (or date) was moved?

You denominate an appointment as an "old event" only by your deduction or there's a logic involved?

Charlize
12-11-2010, 08:40 AM
The only way that I see for handling your appointments, is by using a unique identifier in your appointment. But what if an appointment is deleted, how would you know that ? An altered one can be looked for but you can't look for something that's not available anymore.

Or, the csv is the only file that's correct. Delete the whole calendar and import all your appointments back into your calendar.

Charlize

Benzadeus
12-11-2010, 08:48 AM
Delete the whole calendar and import all your appointments back into your calendar.
If OP uses the calendar only for this purpose, a solution could be delete all the appointments everytime before an import.
It would be like copying SQL's calendar from zero everytime.