Bonjour,

Je travaille sous Lotus 8.5 et j'essaye d'adapter le code ci-dessous. Cependant la macro bug au lancement de Lotus, elle me demande de renseigner mon mot de passe. Je pensais que le MDP se renseignait dans le champs AAA que j'ai mis en bleu gras, mais ça ne fonctionne pas.

Quelqu'un saurait il pourquoi ? Je vous en remercie.

IBM Lotus Notes 8.5

Edition 8.5.2FP3
Révision 20110711.1400-FP3 (Release 8.5.2FP3)
Standard Configuration

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
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
59
60
61
62
63
64
65
Sub SendNotesMail()
    lechemin = "D:\Report\RAL\Histos"
    ledossier = "RAL_L_20120620"
    lefichier = lechemin & "\" & ledossier & ".xls"
 
    On Error GoTo TraiteErreur
 
 
    Dim Maildb As Object 'The mail database
    Dim UserName As String 'The current users notes name
    Dim MailDbName As String 'THe current users notes mail database name
    Dim MailDoc As Object 'The mail document itself
    Dim AttachME As Object 'The attachment richtextfile object
    Dim Session As Object 'The notes session
    Dim EmbedObj As Object 'The embedded object (Attachment)
    Dim ATTACHMENT
 
 
    ATTACHMENT = lefichier
 
    Set Session = CreateObject("Notes.NotesSession")
    MailDbName = "tXXX" & ".nsf"
    'Open the mail database in notes
    Set Maildb = Session.GetDatabase("AAA", MailDbName)
     If Maildb.IsOpen = True Then
          'Already open for mail
     Else
 
     Maildb.OPENMAIL
 
     End If
    'Set up the new mail document
    Set MailDoc = Maildb.CreateDocument
    MailDoc.Form = "Memo"
    MailDoc.Subject = "New inquiry"
    MailDoc.body = "Please find attached a new inquiry"
    MailDoc.SaveMessageOnSend = SaveIt
 
    'PJ
    If ATTACHMENT <> "" Then
        Set AttachME = MailDoc.CreateRichTextItem("Attachment")
        Set EmbedObj = AttachME.EmbedObject(1454, "", ATTACHMENT, "Attachment")
    End If
 
 
    'Send the document
    MailDoc.PostedDate = Now()
    MailDoc.Send 0, "cXXXXX@XXXXX.com"
    Set Maildb = Nothing
    Set MailDoc = Nothing
    Set AttachME = Nothing
    Set Session = Nothing
    Set EmbedObj = Nothing
    Exit Sub
 
TraiteErreur:
    MsgBox "Sorry, something went wrong ...", vbCritical, "Error"
 
    'Clean Up
    Set Maildb = Nothing
    Set MailDoc = Nothing
    Set AttachME = Nothing
    Set Session = Nothing
    Set EmbedObj = Nothing
End Sub