Envoyer un courriel à IBM Notes avec pièce jointe

J'aimerais envoyer un courrier électronique avec une pièce jointe en utilisant VBA et Lotus Notes. Je parviens à envoyer un courrier électronique mais la pièce jointe n'est jamais incluse. Qu'est-ce que j'oublie ici?

Sub Macro1() ActiveWorkbook.Save Dim iMsg As Object Dim iConf As Object Dim strbody As Ssortingng Dim fromAdr As Ssortingng Dim subject As Ssortingng Dim recip As Ssortingng Dim numSend As Integer Dim Attachment1 As Ssortingng ' Mail settings Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Set Flds = iConf.Fields ' Mail fields fromAdr = """[email protected]" recip = """[email protected]" Debug.Print strbody subject = "Orders fondsen" strbody = strbody & "Hi," & vbNewLine & vbNewLine & _ "Please find the document..." ' Fields layout strbody = strbody & vbNewLine & vbNewLine & "Text" Debug.Print strbody strbody = strbody & vbNewLine & vbNewLine & "Kind regards," ' Location attachment Attachment1 = "file-path" ' send mail On Error GoTo handleError With iMsg Set .Configuration = iConf .To = recip .CC = "" .From = fromAdr .subject = subject .TextBody = strbody .Send End With numSend = numSend + 1 GoTo skipError handleError: numErr = numErr + 1 oFile.WriteLine "*** ERROR *** Email for account" & " not sent. Error: " & Err.Number & " " & Err.Description skipError: On Error GoTo 0 MsgBox "Total number of emails send: " & numSend & vbNewLine & "Total number of errors: " & numErr, vbOKOnly + vbInformation, "Operation finished" GoTo endProgram cancelProgram: MsgBox "No emails have been sent.", vbOKOnly + vbExclamation, "Operation cancelled" endProgram: Application.Interactive = True Set iMsg = Nothing Set iConf = Nothing Set dp = Nothing End Sub 

Vous devez append la pièce jointe:

 With iMsg Set .Configuration = iConf .To = recip .CC = "" .From = fromAdr .subject = subject .TextBody = strbody .AddAttachment Attachment1 .Send End With 

Vous pouvez répéter le .AddAttachment pour chaque pièce jointe que vous souhaitez append.