Dear Harry,
Question
Customers with Microsoft® Visual Basic (VB) or VB.NET applications might want to integrate Lotus Notes® e-mail functionality. Is there an example of how to create a Notes® e-mail from Visual Basic?
Answer
The following Microsoft Visual Basic 6 (VB6) code sends a Notes e-mail message. It includes examples of code to include an attachment and to save the sent message, which are both optional and can be removed if desired.
Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
'Start a session to notes
Set Session = CreateObject("Lotus.NotesSession")
'This line prompts for password of current ID noted in Notes.INI
Call Session.Initialize
'or use below to supply password of the current ID
'Call Session.Initialize("<password>")
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("",
"c:\notes\data\mail\mymail.nsf")
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If
'Create the mail document
Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")
'Set the recipient
Call MailDoc.ReplaceItemValue("SendTo", "John Doe")
'Set subject
Call MailDoc.ReplaceItemValue("Subject", "Subject Text")
'Create and set the Body content
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Body text here")
'Example to create an attachment (optional)
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\filename",
"Attachment")
'Example to save the message (optional)
MailDoc.SAVEMESSAGEONSEND = True
'Send the document
'Gets the mail to appear in the Sent items folder
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing
Note: The Visual Basic programmer needs to set the Reference to use
Lotus Domino® objects prior to implementing this function. To enable the Lotus
Notes classes to appear in the Visual Basic browser, you must execute the
following within VB: Select Tools, References and select the checkbox for
'Lotus Notes Automation Classes'.
--
You received this message because you are subscribed to the Google Groups "MS Excel Macro Vba" group.
To post to this group, send email to exce...@googlegroups.com.
To unsubscribe from this group, send email to excel_vba+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/excel_vba?hl=en.
Subject: Lotus Notes 8 HTML Email Signature download | |
|
|
Product Area: Announcement | |
Technical Area: New Features | |
Platform: ALL | |
Release: 8.0.2 | |
Reproducible: Not applicable | |
![]() |
|
Eos Solutions are an IBM Premier Business Partner in Australia and leading supporter of Lotus solutions. We have been offering a Lotus Notes email signature utility for free download from our website for two years. Recently, our utility has been upgraded to Notes Domino version 8.0.2 and is available for free download from the worldwide Lotus community. A lot of people have found this useful, and we hope we can help anyone who is looking for something like this. For more info, visit our webpage: http://www.eos-solutions.com.au/wps/wcm/connect/w3eos/Website/NewsMedia/News/Free+Lotus+Notes+HTML+Email+Signature |
Hello Harpreet,
We Can interrelate all ms office and .net Supported Application using Vba.
I am familiar with Lotus Notes for sending and receiving Mails Only. That’s
why I asked the help for some Lotus Notes Specialist.
Hope IBM.Tools.Specialist (Paulo) will help you, As soon as possible.