1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub AjoutTacheII()
Dim myolApp As New Outlook.Application
Dim myItem As Outlook.TaskItem
Dim objName As Outlook.Namespace
Dim objFolder
Set objName = myolApp.GetNamespace("MAPI")
Set objFolder = objName.GetDefaultFolder(olFolderTasks) '13
Dim dl&
dl = Cells(Rows.Count, 2).End(xlUp).Row
For i = 4 To dl
Set myItem = myolApp.CreateItem(olTaskItem) '3
myItem.Subject = Cells(i, "B") 'Sujet
myItem.StartDate = Cells(i, "C") 'Date de début
myItem.Body = Cells(i, "H") 'Note
myItem.Categories = Cells(i, "D") 'catégorie
myItem.Assign
myItem.ReminderSet = False
myItem.Save
Next i
Set myolApp = Nothing
End Sub |
Partager