I'm having an issue trying to delete appointments programmatically. What I'm doing is handling the AppointmentAdded Event and contrasting the appointment subject (which will contain someones name) against a DB. If the appointment subject (Name) does not appear in the aforementioned DB, then the appointment must be deleted. The problem is that the appointment refuses to be deleted.
Here's the code that I'm using:
AppointmentWithPhone = TryCast(e.Appointment, AppointmentWithPhone)
The output in both debug cases is the same. If I have two appointments and add a third with a name that does not exist in the DB (thus forcing my application to enter inside the "IF") I get this:
Can you help me out? Am I doing it the right way or is there some other way to delete an appointment?