Sub AjoutDansCalendrier2(xid, xTitre, xDateDeb, xHeurDeb, xDuree, xBody)
'---------------------------------------------------------------------------------------
' Création d'un RDV sur Agenda OUTLOOK
'---------------------------------------------------------------------------------------
Dim olapp As Outlook.Application
Dim ObjNS As Outlook.Namespace
Set olapp = CreateObject("outlook.application")
Set ObjNS = olapp.Session
On Error GoTo 0
'---------------------------------------------------------
' Création du RDV
'---------------------------------------------------------
Dim ObjRDV As Outlook.AppointmentItem
Set ObjRDV = ObjNS.GetFolderFromID(xid).Items.Add
xStart = xDateDeb & " " & Deux(Hour(xHeurDeb)) & ":" & Deux(Minute(xHeurDeb)) & ":00"
With ObjRDV
.Subject = xTitre
.Body = xBody
.Start = xStart
.Duration = xDuree 'Valeur entière (exemple 30) exprimée en minutes
.ReminderMinutesBeforeStart = 0
.ReminderSet = True
.Display 'Mettre en commentaire après mise au point
End With
End Sub