Channel | Publish Date | Thumbnail & View Count | Actions |
---|---|---|---|
| 2019-08-31 01:50:33 | ![]() 18,027 Views |
Hi Everyone,
Just want to share the code I created to integrate tasks on MS Project-MSP with MS Outlook Calendar-MSOC, sending notes from MSP to MSOC and to the person on to Team assigned to it.
#continuousimprovement #PMP # #agile #bealearner #agilist #keeplearning #stopcomplaining
The code:
Option Explicit
Public myOLApp As Outlook.Application
‘By Michel Kohler, don´t forget to thank!
Sub Export_Selection_To_OL_Appointments()
Dim myTask As Task
Dim myItem As Outlook.AppointmentItem
Dim myRequiredAttendee As Outlook.Recipient ‘Vas as Set Outlook Recipient
Dim myPResEmail As String ‘Var as email Address-String
On Error Resume Next ‘if error found, jump to next
‘Starts Microsoft Outlook (if it’s not already running) and opens the default Inbox folder
Set myOLApp = CreateObject(/”Outlook.Application/”)
For Each myTask In ActiveSelection.Tasks ‘Loop through the tasks
Set myItem = myOLApp.CreateItem(olAppointmentItem) ‘Create an appointment
With myItem ‘For each appointment do something
.MeetingStatus = olMeeting ‘Set the meeting status to meeting
.Start = myTask.Start ‘Set the start and finish
.End = myTask.Finish
.Subject = myTask.Name & /” (Project Task)/”
.Categories = myTask.Project
.Body = myTask.Notes
.BusyStatus = olFree
‘Add a required attendee
myPResEmail = myTask.Resources(1).EMailAddress ‘Resources(1).EMailAddress
Set myRequiredAttendee = .Recipients.Add(myPResEmail)
myRequiredAttendee.Type = olRequired
‘Set a reminder
.ReminderSet = True
.ReminderOverrideDefault = True
.ReminderMinutesBeforeStart = myTask.Number1
‘Make this appointment unique for later reference
.Categories = myTask.Guid
‘.Class = myTask.Guid
‘.Save
‘Send this meeting invite
.Send
End With
Next myTask
End Sub
Please take the opportunity to connect and share this video with your friends and family if you find it useful.