Bonjour,

Je dois mettre à jour un calendrier SharePoint à partir d'informations Excel.

Ma difficulté : je sais écrire sur mon calendrier, mais je n'arrive pas à accéder au calendrier "Astreinte".

Merci pour votre aide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Sub Ajout_Astreinte_Calendrier()
 
Dim oOutlook As Outlook.Application
Dim oAppointment As Outlook.AppointmentItem
Dim myreciient As Outlook.Items
Dim namespaceOutlook As Outlook.Namespace
Dim DossierCalendrier As Outlook.MAPIFolder
Dim Dernligne As Integer
Dim i As Integer
Dim debastreinte As Date
Dim finastreinte As Date
 
'gestion d'erreurs
On Error GoTo Err_Execution
 
'on crée ensuite les objets
Set oOutlook = CreateObject("Outlook.Application")
Set namespaceOutlook = oOutlook.GetNamespace("MAPI")
'
'définit le dossier calendrier
Set myrecipient = namespaceOutlook.CreateRecipient("Astreinte")
myrecipient.Resolve
If myrecipient.Resolved Then
Set DossierCalendrier = namespaceOutlook.GetSharedDefaultFolder(myrecipient, olFolderCalendar)
End If