Hi,
I am trying to send email from EXCEL/VBA through Lotus Notes and to attach files to the email that I send. After having checked a few fora, I know now how do the email thing, and I also know how to attach one file to the mail, but how do I do to attach any number of files?
The code I use looks something like this:
I have it in a function, so all the necessary info about recipient, subject and the name of the file that I want to attach etc is passed through the arguments of this function.
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = Bodytext
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
'MailDoc.CREATERICHTEXTITEM ("Attachment")
End If
'Send the document
The section in red are the statements I use to attach the file, the name of which is in the string Attachment. But how do I do attach more files?
Grateful for any help
Bengt
I am trying to send email from EXCEL/VBA through Lotus Notes and to attach files to the email that I send. After having checked a few fora, I know now how do the email thing, and I also know how to attach one file to the mail, but how do I do to attach any number of files?
The code I use looks something like this:
I have it in a function, so all the necessary info about recipient, subject and the name of the file that I want to attach etc is passed through the arguments of this function.
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = Bodytext
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
'MailDoc.CREATERICHTEXTITEM ("Attachment")
End If
'Send the document
The section in red are the statements I use to attach the file, the name of which is in the string Attachment. But how do I do attach more files?
Grateful for any help
Bengt