 |
|
 |
Subject: Sending mail from vba excel through lotus notes 8.5 |
 |
 |
 |
Product Area: Notes Client |
 |
Technical Area: Application Development |
 |
Platform: Windows |
 |
Release: 8.5 |
 |
Reproducible: Always |
 |
 |
 |
 |
Dear all,
I am trying to send link in lotus notes mail. but I am not able to do it. lotus notes mail format should be html. kindly go through this code. This code works fine in vba excel. I am not that expert in lotus programming so not able to get required code on net.
' Notes variables
Set s = CreateObject("Notes.NotesSession")
Set db = s.CurrentDatabase
Set stream = s.CreateStream
' Turn off auto conversion to rtf
s.ConvertMIME = False
' Create message
Set message1 = db.CreateDocument
message1.Form = "Memo"
Set body = message1.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("Testing, kindly delete the message")
message1.Subject = (" New business updates for date " & day1 & "-" & MonthName(month1) & "-" & year1)
Set header = body.CreateHeader("To")
Call header.SetHeaderVal(ThisWorkbook.Sheets("Main").Cells(9, 16358).Value)
Set header = body.CreateHeader("cc")
Call header.SetHeaderVal(ThisWorkbook.Sheets("Main").Cells(8, 16358).Value)
' Create the body to hold HTML and attachment
link1 = ThisWorkbook.Sheets("Main").Cells(y, 57).Value
'Child mime entity which is going to contain the HTML which we put in the stream
Set bodyChild = body.CreateChildEntity()
Call stream.WriteText("<HTML>")
Call stream.WriteText("Dear,")
Call stream.WriteText("<br>")
Call stream.WriteText("<tr>")
Call stream.WriteText("<td>Kindly find link to your file updated with information for new business updates for date " & day1 & "-" & month1 & "-" & year1 & "</td>")
'Call stream.WriteText("<td>" & ThisWorkbook.Sheets("Main").Cells(y, 57).Value & "</td>") ; need code here, the cell reference contain link to other excel file
Call stream.WriteText(link1)
Call stream.WriteText("<br>")
Call stream.WriteText("<br>")
Call stream.WriteText("</tr>")
Call stream.WriteText("</HTML>")
Call bodyChild.SetContentFromText (stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT)
message1.SaveMessageOnSend = True
'Send the email
Call message1.Send(False)
s.ConvertMIME = True ' Restore conversion
 
Feedback number WEBB9BVJNE created by ~Sigmund Fronibur on 09/25/2013

Status: Open
Comments:

Sending mail from vba excel through... (~Sigmund Fronib... 25.Sep.13)
. . Where/how does the code fail? (~Martha Lopjipy... 25.Sep.13) |
|  |
|