Consulting

Results 1 to 4 of 4

Thread: Deleting old calendar events when importing new ones

  1. #1

    Deleting old calendar events when importing new ones

    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!





  2. #2
    VBAX Tutor Benzadeus's Avatar
    Joined
    Dec 2008
    Location
    Belo Horizonte, Brazil
    Posts
    271
    Location
    Quote Originally Posted by victoria6148
    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?
    ---
    Felipe Costa Gualberto
    Microsoft Excel MVP
    http://www.ambienteoffice.com.br

  3. #3
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    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

  4. #4
    VBAX Tutor Benzadeus's Avatar
    Joined
    Dec 2008
    Location
    Belo Horizonte, Brazil
    Posts
    271
    Location
    Quote Originally Posted by Charlize
    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.
    ---
    Felipe Costa Gualberto
    Microsoft Excel MVP
    http://www.ambienteoffice.com.br

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •