Sub kidwispa()
'
Dim UserName As String
Dim MailDbName As String
Dim Recipient As Variant
Dim ccRecipient As String
Dim Attachment1 As String
Dim Attachment2 As String
Dim Attachment3 As String
Dim Attachment4 As String
Dim Attachment5 As String
Dim Maildb As Object
Dim MailDoc As Object
Dim AttachME As Object
Dim AttachME2 As Object
Dim AttachME3 As Object
Dim AttachME4 As Object
Dim AttachME5 As Object
Dim Session As Object
Dim EmbedObj1 As Object
Dim EmbedObj2 As Object
Dim EmbedObj3 As Object
Dim EmbedObj4 As Object
Dim EmbedObj5 As Object
Dim stSignature As String
With Application
.ScreenUpdating = False
.DisplayAlerts = False
' Open and locate current LOTUS NOTES User
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)
If Maildb.IsOpen = True Then
Else
Maildb.OPENMAIL
End If
' Create New Mail and Address Title Handlers
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
stSignature = Maildb.GetProfileDocument("CalendarProfile").GetItemValue("Signature")(0)
' Select range of e-mail addresses
Recipient = Array("Joe_Boe@somewhere.com", "kristen_Dean@somewhere.com", "john_doe@somewhereelse.com", "jane.doe@anotherplace.com")
MailDoc.SendTo = Recipient
MailDoc.Subject = "PUT YOUR SUBJECT HERE"
MailDoc.Body = _
"Now is the time for all good men to come too the aid of their country"
' Select Workbook to Attach to E-Mail
MailDoc.SaveMessageOnSend = True
Attachment1 = "D:\common\data\excel\Attachment1.xls" '"C:\YourFile.xls" ' Required File Name
If Attachment1 <> "" Then
On Error Resume Next
Set AttachME = MailDoc.CREATERICHTEXTITEM("attachment1")
Set EmbedObj1 = AttachME.embedobject(1454, "attachment1", "D:\common\data\excel\Attachment1.xls", "") 'Required File Name
On Error Resume Next
End If
Attachment2 = "D:\common\data\excel\Attachment2.xls" '"C:\YourFile.xls" ' Required File Name
If Attachment2 <> 0 Then
On Error Resume Next
Set AttachME2 = MailDoc.CREATERICHTEXTITEM("attachment2")
Set EmbedObj2 = AttachME.embedobject(1454, "attachment2", "D:\common\data\excel\Attachment2.xls", "") 'Required File Name
On Error Resume Next
End If
Attachment3 = "D:\common\data\excel\Attachment3.xls" '"C:\YourFile.xls" ' Required File Name
If Attachment3 <> "" Then
On Error Resume Next
Set AttachME3 = MailDoc.CREATERICHTEXTITEM("attachment3")
Set EmbedObj3 = AttachME.embedobject(1454, "attachment3", "D:\common\data\excel\Attachment3.xls", "") 'Required File Name
On Error Resume Next
End If
Attachment4 = "D:\common\data\excel\Attachment4.xls" '"C:\YourFile.xls" ' Required File Name
If Attachment4 <> "" Then
On Error Resume Next
Set AttachME4 = MailDoc.CREATERICHTEXTITEM("attachment4")
Set EmbedObj4 = AttachME.embedobject(1454, "attachment4", "D:\common\data\excel\Attachment4.xls", "") 'Required File Name
On Error Resume Next
End If
Attachment5 = "D:\common\data\excel\Attachment5.xls" '"C:\YourFile.xls" ' Required File Name
If Attachment5 <> "" Then
On Error Resume Next
Set AttachME5 = MailDoc.CREATERICHTEXTITEM("attachment5")
Set EmbedObj5 = AttachME.embedobject(1454, "attachment5", "D:\common\data\excel\Attachment5.xls", "") 'Required File Name
On Error Resume Next
End If
MailDoc.PostedDate = Now()
On Error GoTo errorhandler1
MailDoc.SEND 0, Recipient
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set AttachME2 = Nothing
Set AttachME3 = Nothing
Set AttachME4 = Nothing
Set AttachME5 = Nothing
Set Session = Nothing
Set EmbedObj1 = Nothing
Set EmbedObj2 = Nothing
Set EmbedObj3 = Nothing
Set EmbedObj4 = Nothing
Set EmbedObj5 = Nothing
.ScreenUpdating = True
.DisplayAlerts = True
End With
errorhandler1:
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set AttachME2 = Nothing
Set AttachME3 = Nothing
Set AttachME4 = Nothing
Set AttachME5 = Nothing
Set Session = Nothing
Set EmbedObj1 = Nothing
Set EmbedObj2 = Nothing
Set EmbedObj3 = Nothing
Set EmbedObj4 = Nothing
Set EmbedObj5 = Nothing
End Sub