Cancel Outlook appointment from MS Project

luminousplumz

New Member
Joined
Dec 11, 2013
Messages
1
Morning All

Need abit of your superior wisdom.
I currently have code to send out a Meeting/Appointment request for a highlighted task in Project to the resources/engineer.
This i have managed to do, but i am completely stuck on how to send out a cancel meeting/appointment request for the selected task(s).
Below is my meeting request code and i think i need to use the appointment.delete method but i fail miserably when trying to hit the jackpot.




Rich (BB code):
Sub Export_Calender()
Dim myTask As Task
Dim myDelegate As Object
Dim myItem As Outlook.AppointmentItem

On Error Resume Next
Set myOLApp = CreateObject("Outlook.Application")
For Each myTask In ActiveSelection.Tasks
Set myItem = myOLApp.CreateItem(olAppointmentItem)
myItem.Assign
With myItem
Set myDelegate = myItem.Recipients.Add(myTask.Resources(1).EMailAddress)
myDelegate.Resolve
.Start = myTask.Start
.End = myTask.Finish
.subject = myTask.Name & " "
.Location = myTask.Text1
.OrderNumber = myTask.Text2
.IC = myTask.Text3
.Shift = myTask.Text5
.WorkType = myTask.Text4
.SiteContact = myTask.Text6
.Categories = myTask.Project
.Body = "Location - " & myTask.Text1 & vbNewLine & "Order Number - " & myTask.Text2 & vbNewLine & "IC - " & myTask.Text3 & vbNewLine & "Shift - " & myTask.Text5 & vbNewLine & "Work Type - " & myTask.Text4 & vbNewLine & "Site Contact - " & myTask.Text6 & vbNewLine & vbNewLine & "****************************" & vbNewLine & "Notes" & vbNewLine & myTask.Notes
.Display
.Send
MsgBox " Appointment sent"


End With
Next myTask

End Sub

Please please help
 
Last edited by a moderator:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,225,657
Messages
6,186,257
Members
453,347
Latest member
mrizkiii28

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top