I tried the following VBA code it works fine. Is there away I can export only
selected tasks not all of them?
http://www.outlookcode.com/codedetail.aspx?id=1165
Sub OutlookLink()
Dim appOL As Outlook.Application
Dim mspTask As MSProject.Task
Dim olTask As Outlook.TaskItem
Dim i As Integer
On Error GoTo objerror
Set appOL = GetObject(, "Outlook.Application") ' if Outlook is running,
this line will work
resumeplace:
For Each mspTask In MSProject.ActiveProject.Tasks
If Not (mspTask Is Nothing) Then
Set olTask = appOL.CreateItem(olTaskItem)
'note that you can capture other Project fields into Outlook fields
olTask.Subject = mspTask.Name
olTask.Body = mspTask.Name
olTask.DueDate = mspTask.EarlyFinish
olTask.StartDate = mspTask.EarlyStart
olTask.Role = mspTask.ID
olTask.PercentComplete = mspTask.PercentComplete
olTask.Save
Set olTask = Nothing
End If
i = i + 1
Next
MsgBox "Cheryl, " & i & " tasks were exported to Outlook!"
Exit Sub
objerror: ' if Outlook is not running, this will work
Err.Clear
Set appOL = CreateObject("Outlook.Application")
GoTo resumeplace
End Sub