Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub transfert_données() Dim conn As ADODB.Connection Set conn = New ADODB.Connection Dim rst As ADODB.Recorset Set rst = New Recordset With conn .Provider = "Microsoft.JET.OLEDB.4.0" .Open "C:\base\cabinet.mdb" End With With rst .ActiveConnection = conn .Open "Select * from ROutlook_général", conn .fields("document_nbre_page").Value = nbrepage .fields("Document_copie").Value = nomdoc .fields("Code_dossier").Value = nomdoc3 .fields("Code_document").Value = codedoc .Update End With rst.Close conn.Close For Each x In rst.fields hd = "HoraireDebut" dur2 = "durée" intitule = "CP" Next Set Rdv = OkApp.CreateItem(olAppointmentItem) With Rdv .MeetingStatus = olMeeting .Subject = intitule .Body = "...tout est dit, c'est le body ...." .Location = "ici la location" .Start = hd ' Attention : format mois/jours/année .Duration = dur2 'minutes .Categories = "professionnel" .Save End With End Sub
Sub transfert_données() Dim conn As ADODB.Connection Set conn = New ADODB.Connection Dim rst As ADODB.Recordset Set rst = New Recordset With conn .Provider = "Microsoft.JET.OLEDB.4.0" .Open "C:\base\cabinet.mdb" End With With rst .ActiveConnection = conn .Open "ROutlook_général", LockType:=adLockOptimistic End With nbrelignes = 0 Do While Not rst.EOF nbrelignes = nbrelignes + 1 rst.MoveNext Loop Dim OkApp As New Outlook.Application Dim Rdv As Outlook.AppointmentItem rst.MoveFirst For N = 1 To nbrelignes ddébut = rst.Fields(0).Value hdébut = rst.Fields(2).Value dfin = rst.Fields(4).Value hfin = rst.Fields(5).Value catégorie = rst.Fields(19).Value emplacement = rst.Fields(20).Value coordonnées = rst.Fields(21).Value objet = rst.Fields(22).Value durée = rst.Fields(6).Value Set Rdv = OkApp.CreateItem(olAppointmentItem) With Rdv .MeetingStatus = olMeeting .Subject = objet .Body = coordonnées .Location = emplacement .Start = ddébut ' Attention : format mois/jours/année .Duration = durée 'minutes .Categories = catégorie .Recipients.Add ("monadresse@monadresse.be") 'Destinataire de la réunion .Send .Save End With rst.MoveNext Next N rst.Close conn.Close End Sub