Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting outlook appointments via external proc doesnt del attendee 1

Status
Not open for further replies.

MartyK101

Technical User
Jun 12, 2006
3
GB
Hi guys,
my issue is very similar to
thread707-1066147 except that I wish to delete an appointment.

To simplfy the issue I have created a vb6 program with a button which starts the code below.
If the item to be deleted is a meeting with 3 attendess I expected the 3 to receive meeting cancelled emails which removed the appointment from there calenders (which works fine if I place the code in an internal outlook calendar form)

what am I doing wrong
how can I fix it
thanks
MartyK

Dim oApp As Outlook.Application
Dim oNameSpace As Outlook.NameSpace
Dim oAppointments As Outlook.Items
Dim oItem As Outlook.AppointmentItem

Set oApp = New Outlook.Application
Set oNameSpace = oApp.GetNamespace("MAPI")
oNameSpace.Logon
Set oAppointments = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar).Items

' The entry id of the appointment to delete is below
Set oItem = oNameSpace.GetItemFromID("00000000C1F3F42B8674A140AF40F07B7655E33D0700ECD91EB68018C04CA1B6801EE47A910F000037F1413E00000E89DCB12580C9448B1B076E1F1F6D1E000000B609D20000")
If Not (oItem Is Nothing) Then
oItem.Delete
End If



oNameSpace.Logoff
Set oAppointments = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
MsgBox "Done
 
MartyK101,
I think you need to set the [tt]MeetingStatus[/tt] to Canceled, send the item, then delete.

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Hey CautionMP
thanks for that.

it works great with a small exception

the other attendee's appointment is marked to cancelled , rather than deleted - they dont even receive an email that stays in their inbox stating the appointment was cancelled.


Its not a biggy and in actuality its propbably better for the other attendee to see that the meeting has been cancelled.

I was just wondering how activesync et all do this as they seem to be able to delete the entry from the attendees calendar.

thanks
Martk
 
MartyK101,
You meeting participant probably has the Automatically accept meeting requests and process cancellations flag set (Outlook 2k: Tools => Options, Calendar Options, Resource Scheduling). If you turn this off I think you have the option of deleting the appointment when the cancellation request is received.

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Aha
that may be it
cor isnt outlook complex!!!!

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top