Sub MULTISENDFUNCTIONEOD()
Dim MyPic1 As Object, MyPic2 As Object
Application.ScreenUpdating = False
Set MyPic1 = ActiveSheet.Pictures.Insert( _
"M:\EXPORTS\02_FEBRUARY\CMS\DAILY\1.jpg")
Set MyPic2 = ActiveSheet.Pictures.Insert( _
"M:\EXPORTS\02_FEBRUARY\CMS\DAILY\2.jpg")
Call SendMail(MyPic1, MyPic2)
MyPic1.Delete: MyPic2.Delete
Set MyPic1 = Nothing: Set MyPic2 = Nothing
Application.ScreenUpdating = True
End Sub
Private Sub SendMail(ByRef MyPic1 As Object, ByRef MyPic2 As Object)
Dim Notes As Object, db As Object, WorkSpace As Object
Dim UIdoc As Object, AttachMe As Object, EmbedObj As Object
Dim UserName As String, MailDbName As String
Set Notes = CreateObject("Notes.NotesSession")
UserName = Notes.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, _
(Len(UserName) - InStr(1, UserName, " "))) & "Name.sf"
Set db = Notes.GetDataBase(vbNullString, MailDbName)
Set WorkSpace = CreateObject("Notes.NotesUIWorkspace")
Call WorkSpace.ComposeDocument(, , "Memo")
Set UIdoc = WorkSpace.CurrentDocument
Call UIdoc.FieldSetText("SendTo", "Name/CCMG/CVG") 'Recipient
Call UIdoc.FieldSetText("Subject", "Pic Time")
Call UIdoc.GotoField("Body")
Call UIdoc.InsertText(WorksheetFunction.Substitute( _
"Hey Buddy,@@Check out the pics eh!@@", _
"@", vbCrLf))
MyPic1.Copy: Call UIdoc.Paste
Call UIdoc.InsertText(WorksheetFunction.Rept(vbCrLf, 2))
MyPic2.Copy: Call UIdoc.Paste
Call UIdoc.InsertText(Application.Substitute( _
"@@Don't Be A Stranger,@Moi", "@", vbCrLf))
Application.CutCopyMode = False
Set AttachMe = UIdoc.Document.CreateRichtextitem("Attachment")
Set EmbedObj = AttachMe.EmbedObject(1454, _
vbNullString, "M:\EXPORTS\02_FEBRUARY\CMS\DAILY\comment.txt", "Attachment")
UIdoc.Document.posteddate = Now
'Call UIdoc.Send(False)'
Call UIdoc.Close
Set UIdoc = Nothing: Set WorkSpace = Nothing
Set db = Nothing: Set Notes = Nothing
Set EmbedObj = Nothing: Set AttachMe = Nothing
End Sub