Macro para enviar correo masivo... Como puedo agregar archivos adjuntos y otro destinatario en el programa? (IBM lotus notes)
Quiero adjuntar archivos adjuntos y agregar a otro destinatarion en un mail masivo..., pero no he podido encontrar la funcion adecuada, lo desarrolle para Lotus notes IBM.
Private Sub CommandButton1_Click()
Dim sSignature, oWorksheet, oNotesSession, oMailDBName, oNotesMail, bDebug
On Error GoTo 0
Set oWorksheet = Application.ActiveWorkbook.Worksheets.Item(2)
Set oNotesSession = CreateObject("Notes.NotesSession")
bDebug = True
Set oMailDB = oNotesSession.GETDATABASE("", "")
If oMailDB.IsOpen = True Then
If bDebug Then MsgBox ("Mail database for user " & sUserName & " is already open.")
Else
If bDebug Then MsgBox ("Opening mail database for user " & sUserName)
oMailDB.OPENMAIL
End If
sSignature = oMailDB.GETPROFILEDOCUMENT("CalendarProfile").GETITEMVALUE("Signature")(0)
iRow = 1
Do While oWorksheet.Cells(iRow, 1).Value <> "" And iRow <= 300000
If bDebug Then MsgBox ("Processing line " & iRow & ": " & oWorksheet.Cells(iRow, 5).Value)
Set oNotesMail = oMailDB.CreateDocument
oNotesMail.Form = "Memo"
oNotesMail.SendTo = oWorksheet.Cells(iRow, 2).Value
oNotesMail.Subject = "<" & oWorksheet.Cells(iRow, 1).Value & "> " & oWorksheet.Cells(iRow, 5).Value
oNotesMail.Body = oWorksheet.Cells(iRow, 6).Value & " " & oWorksheet.Cells(iRow, 1).Value & vbCr & vbCr & oWorksheet.Cells(iRow, 7).Value & ": " & oWorksheet.Cells(iRow, 3).Value & vbCr & vbCr & oWorksheet.Cells(iRow, 8).Value
oNotesMail.SaveMessageOnSend = True
oNotesMail.PostedDate = Now()
oNotesMail.Send 0, oWorksheet.Cells(iRow, 2).Value
Set oNotesMail = Nothing
iRow = iRow + 1
Loop
If bDebug Then MsgBox ("Finished after processing " & (iRow - 1) & " lines.")
Set oMailDB = Nothing
Set oNotesSession = Nothing
End Sub