Envoi d'email par excel et Lotus Notes: pièces jointes et sauvegarde du mail

B

bruno

Guest
Bonjour à tous,

Je désire envoyer des emails en utilisant excel 97 et lotus notes.
J'ai deja troouvé comment faire grace a ce forum, mais j'ai encore 2 point que je n'arrive pas à résoudre:

Deja voici ma macro:

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)
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Get the sessions username and then calculate the mail file name
'You may or may not need this as for MailDBname with some systems you
'can pass an empty string
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
'Open the mail database in notes
Set mailDb = Session.GETDATABASE("", 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.sendTo = recipient
mailDoc.Subject = "Outercase Label for " & texte & " " & pf
mailDoc.body = " Hello," & Chr(10) & Chr(10) & "Please find enclosed the outercase label for " & texte & " for approval." & Chr(10) & Chr(10) & Chr(10) & Chr(10) & "MfG / Regards / Salutations" & Chr(10) & Chr(10) & "Bruno Anouzet" & Chr(10) & "New Projects" & Chr(10) & "Tel: +33 (0)3 87 98 73 07" & Chr(10) & "Fax: +33 (0)3 87 98 77 11"
mailDoc.ReturnReceipt = "0"
mailDoc.SAVEMESSAGEONSEND = True
'Set up the embedded object and attachment and attach it
Attachment = "g:\commun\li\kk\kk 2005\" & pf & ".bmp" 'Mise en piece jointe du fichier concerné
If Attachment <> "" Then
Set AttachME = mailDoc.CREATERICHTEXTITEM("Attachment" & i)
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
mailDoc.CREATERICHTEXTITEM ("Attachment" & i)
End If

'Send the document
mailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
mailDoc.SEND 0, recipient
'Clean Up
Set mailDb = Nothing
Set mailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing

Elle fonctionne.

2 questions:

- j'aimerai sauvegarder les emails envoyer dans un repertoire particulier de lotus notes, et pas slt dans envoyé

- j'aimerai joindre une copie d'ecran à mon email, mais deja intégré a l'email, et pas en tant que piece jointe comme mon fichier BMP. Sachant que j'ai le logiciel: Hardcopy pour cela.

J'espere que vous pourrez m'aidez.

Merci d'avance
 

Discussions similaires

Statistiques des forums

Discussions
312 490
Messages
2 088 875
Membres
103 980
dernier inscrit
grandmasterflash38