VbaNewbie08
Technical User
I found the code below for sending an email throught lotus notes. The problem i'm having is i need it to copy Range(A1:G20) as an image and insert into the body. Im not quite sure how to do this.
Sub SendNotesMail()
Dim Maildb As Object, UserName As String, MailDbName As String
Dim MailDoc As Object, Session As Object
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
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.SendTo = "RTV_Coordinator_MIDB" 'Nickname or full address
MailDoc.Subject = "RTV Dollars"
MailDoc.Body =
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now
On Error GoTo Audi
Call MailDoc.Send(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
Exit Sub
Audi:
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
MsgBox "Email Error"
End Sub
Sub SendNotesMail()
Dim Maildb As Object, UserName As String, MailDbName As String
Dim MailDoc As Object, Session As Object
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
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.SendTo = "RTV_Coordinator_MIDB" 'Nickname or full address
MailDoc.Subject = "RTV Dollars"
MailDoc.Body =
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now
On Error GoTo Audi
Call MailDoc.Send(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
Exit Sub
Audi:
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
MsgBox "Email Error"
End Sub