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
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