ouvrir lotus et envoi de mail par VBA
Bonjour,
Voici mon texte vba pour faire un mail automatique mais je n'arrive pas a ouvrir automatiquement Lotus car il ne me prend pas le mot de passe
Pourriez vous m'aider
Code:
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| Dim domSession As New NotesSession
Dim domNotesDBMailFile As NotesDatabase
Dim domNotesDocumentMemo As NotesDocument
Dim domNotesRichText As NotesRichTextItem
Dim strAttachment As String
Dim strAttachment1 As String
Dim rrecip(15) As Variant
rrecip(0) = "Olivier D'ANDREIS/FRANCE/PARFUMS_DIOR"
rrecip(1) = ""
rrecip(2) = ""
rrecip(3) = ""
rrecip(4) = ""
rrecip(5) = ""
rrecip(6) = ""
rrecip(7) = ""
rrecip(8) = ""
rrecip(9) = ""
rrecip(10) = ""
rrecip(11) = ""
rrecip(12) = ""
rrecip(13) = ""
rrecip(14) = ""
rrecip(15) = ""
Dim Chemin$, Client$, Fichier$
Chemin = "\XXXXXXXXXXXX"
Client = Format(Now, "dd mmmm yyyy")
Fichier = "XXXXXXXX " & Client & ".pdf"
monfichier = Chemin & Fichier
Dim ALIGNMENT As Integer
Set Lotus_Session = CreateObject("Notes.NotesSession")
domSession.Initialize ("XXXXXXX") 'Mot de passe de l'utilisateur pour Lotus Notes.
Set domNotesDBMailFile = domSession.GetDatabase("", "names.nsf")
Set domNotesDocumentMemo = domNotesDBMailFile.CreateDocument
Call domNotesDocumentMemo.AppendItemValue("Form", "Memo")
Call domNotesDocumentMemo.AppendItemValue("copyto", rrecip)
Call domNotesDocumentMemo.AppendItemValue("Subject", "Fichiers C.I.D")
Set domNotesRichText = domNotesDocumentMemo.CreateRichTextItem("Body")
domNotesRichText.AppendText ("Bonjour," & Chr(10) & Chr(10) & "Les fichiers de la journée" & Chr(10) & Chr(10) & Chr(10))
strAttachment = monfichier
Call domNotesRichText.EmbedObject(EMBED_ATTACHMENT, "", strAttachment, "")
domNotesRichText.AppendText (Chr(10) & "Bonne réception" & Chr(10) & Chr(10) & "Cdt" & Chr(10) & Chr(10) & "----------------------------------------------" & Chr(10) & Chr(10) & "Adoptez l 'éco-attitude. N'imprimez ce mail que si c'est vraiment nécessaire" & Chr(10) & "Consider the environment before printing this mail.")
domNotesDocumentMemo.Send False, recip
'domNotesDocumentMemo.Send (False)
'envoie du mail
End Sub |