Agenda de groupe
Le code suivant me permet d'écrire une entrée dans l'agenda notes, mais dans l'agenda de groupe les journées ne sont pDim cEntry As NotesDocument Dim rtitem As Variant Dim itemIcon As NotesItem Dim books As Variant Dim viewCalendar As NotesView Dim PersonDoc As NotesDocument Dim person As String Dim success As Variant Dim answer As Integer Dim done As Variant Dim heuredebut As Variant Dim heurefin As Variant books = session.AddressBooks person = Source.fieldgettext("benef") done = False Forall b In books If (b.IsPublicAddressBook) And ( Not done) Then Call b.Open( "","" ) Set viewCalendar = b.GetView( "($VIMPeople)") Set PersonDoc = viewCalendar.GetDocumentByKey( person ) If Not (PersonDoc Is Nothing ) Then Call dbCalendar.Open( PersonDoc.MailServer(0), PersonDoc.MailFile(0) + ".nsf" ) Set cEntry = dbCalendar.CreateDocument cEntry.From = UName.Canonical cEntry.Form = "Appointment" cEntry.AppointmentType = "2" cEntry.CHAIR = UName.Canonical cEntry.ApptUNID = cEntry.UniversalID cEntry.Body = "" cEntry.BookFreeTime = "" cEntry.Logo = "StdNotesLtr5" cEntry.SequenceNum = 1 cEntry.OrgTable = "P0" Set itemIcon = cEntry.AppendItemValue( "_ViewIcon", 9) If Source.fieldgettext("Motif_01") <> "" Then If Source.fieldgettext("demijournee_D01") = "Journée" Then heuredebut = "00:00:01" Else If Source.fieldgettext("demijournee_D01") = "Matinée" Then heuredebut = "00:00:01" Else heuredebut = "14:00:00" End If End If If Source.fieldgettext("demijournee_F01") = "Journée" Then heurefin = "23:59:59" Else If Source.fieldgettext("demijournee_D01") = "Matinée" Then heurefin = "13:00:00" Else heurefin = "23:59:59" End If End If cEntry.EndDateTime = Cdat(source.fieldgettext("Fin_01") & " " & heurefin ) cEntry.StartDateTime = Cdat(source.fieldgettext("Début_01") & " " & heuredebut ) cEntry.StartDate = Cdat(source.fieldgettext("Début_01") & " " & heuredebut ) cEntry.EndDate = Cdat(source.fieldgettext("Fin_01") & " " & heurefin ) cEntry.CalendarDateTime = Cdat(source.fieldgettext("Début_01") & " " & heuredebut ) success = cEntry.ComputeWithForm(False, True) If success Then cEntry.Subject = Source.fieldgettext("Motif_01_1") Call cEntry.Save(True, True) Else answer = Messagebox( "Le document 1 n'a pas été sauvegardé dans l'agenda Notes de " &UName.Common & " . Veuillez vérifier la valeur des champs !", 0+16+0+0, "Attention") End If End If