Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Previous Next
Subject: Sending mail from vba excel through lotus notes 8.5
Feedback Type: Problem
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 abhijit kadam on 09/25/2013

Status: Open

Sending mail from vba excel through... (abhijit kadam 25.Sep.13)
. . Where/how does the code fail? (Doug Finner 25.Sep.13)


Search this forum

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite