E-mailing tasks from MS Project using vba

S

S1lverface

I have found the vba code through the group to send emails based on tasks
having a dependency. What if they do not have a dependency? I need something
slightly different. I want to send an e-mail to all resources whose
assignment is due to start date is within 10 days from now.

Any help please.......
 
G

Gérard Ducouret

Hello S1lverface,

You can adapt your previous macro with the Assignment property:

Sub Assignment10d()
Dim oTask As Task, Asgt As Assignment

For Each oTask In ActiveProject.Tasks
If Not oTask Is Nothing Then
For Each Asgt In oTask.Assignments
If Asgt.Start - Date <= 10 Then
MsgBox "send a mail : " & Asgt.Start - Date & " " &
Asgt.ResourceName, , "Assignment start : " & Asgt.Start
End If
Next Asgt
End If
Next
End Sub

Hope this helps,

Gérard Ducouret
 
S

S1lverface

Thanks Gerard,

With a bit of shuffling around, I got it to work.
Much appreciated.
Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top