Re : Import tache Outlook depuis Excel
RE
En cherchant un peu sur le web anglophone
J'ai trouvé ceci (que j'ai adapté à ma copie d'écran du message#16)
TestOK sur Outlook 2003
La macro ne récrée pas les taches déjà existantes dans Outlook.
Je te laisse tester et t'encourage également à faire des recherches sur le vaste web.
Il n'y a pas de raison que tu ne trouves pas toi-même ce que j'ai trouvé en " g..glant" dans mon browsr. 😉
Code vba:
Sub ExportToOutlook()
Dim OL As Outlook.Application
Dim olAppt As TaskItem
Dim NS As Outlook.Namespace
Dim colItems As Outlook.Items
Dim olApptSearch As TaskItem
Dim r As Long, sSubject As String, sBody As String
Dim dStartDate As Date, dDueDate As Date
Dim sSearch As String, bOLOpen As Boolean
On Error Resume Next
Set OL = GetObject(, "Outlook.Application")
bOLOpen = True
If OL Is Nothing Then
Set OL = CreateObject("Outlook.Application")
bOLOpen = False
End If
Set NS = OL.GetNamespace("MAPI")
Set colItems = NS.GetDefaultFolder(olFolderTasks).Items
For r = 4 To 8 'ici adaptes selon la configuration de ton fichier
sSubject = Cells(r, "B").Value
dStartDate = Cells(r, "C").Value
sBody = Cells(r, "H").Value
sSearch = "[Subject] = " & sQuote(sSubject)
Set olApptSearch = colItems.Find(sSearch)
If olApptSearch Is Nothing Then
Set olAppt = OL.CreateItem(olTaskItem)
olAppt.Subject = sSubject
olAppt.StartDate = dStartDate
olAppt.Body = sBody
olAppt.Close olSave
End If
Next r
If bOLOpen = False Then OL.Quit
End Sub
Function sQuote(sTextToQuote)
sQuote = Chr(34) & sTextToQuote & Chr(34)
End Function