I hv created a listbox with 2 columns whereby display all the email addresses in first column and names on the second column. I want to send an email by selecting email address and it will open lotus email. Once the email is open, the email address will auto add to the send to field. May I know is it possible to do in such a matter as I explained?If yes, so how to go about it? pls help..tks..
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
send lotus note email from listbox (a97)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » send lotus note email from listbox (a97)
- This topic has 22 replies, 5 voices, and was last updated 20 years, 10 months ago.
AuthorTopicWSnuglorious
AskWoody LoungerMay 22, 2003 at 3:17 am #387900Viewing 0 reply threadsAuthorReplies-
WSready4data
AskWoody LoungerMay 22, 2003 at 7:23 pm #678990I have some code that will send emails using Lotus notes 5.0 from within Access. The email address portion of your listbox is no problem but what do you want to place in the subject line and the body of the email. Where will this info come from? Otherwise you will be sending a blank email to someone.
-
WSnuglorious
AskWoody LoungerMay 23, 2003 at 12:46 am #679063Tht means besides of just create to open lotus email, it can also do more than tht? At first, I was thought only once the lotus email is open, I will key in there in the subject line and the body of the email. If Access can do include the subject line and body as well, then what if i create 2 textbox to input subject line and another for body of the email? Is that what I understanding is correct. If so, I can send email direct from Access instead?
-
WSready4data
AskWoody LoungerMay 23, 2003 at 11:01 am #679152 -
WSDAC
AskWoody Lounger -
WSready4data
AskWoody LoungerMarch 11, 2004 at 6:49 pm #797762Brian,
I never had to check for that since we use Lotus company wide.
don’t know if this is want you want but….
you can use a hyperlink to bring up the default mail client
e.g. mailto: Me@woodys.com
the link will open up your default mail client -
WSready4data
AskWoody LoungerMarch 11, 2004 at 6:49 pm #797763Brian,
I never had to check for that since we use Lotus company wide.
don’t know if this is want you want but….
you can use a hyperlink to bring up the default mail client
e.g. mailto: Me@woodys.com
the link will open up your default mail client
-
-
WSDAC
AskWoody Lounger -
WSpatt
AskWoody LoungerJuly 10, 2004 at 9:39 pm #848672Can someone tell me how to send an attachment with the code that is used to send an email in this database. The following code comes from that database.
Private Sub cmdSEND_Click() Dim s As Object Dim db As Object Dim Doc As Object Dim rtItem As Object Dim Server As String, Database As String Dim strError As String Dim Item As String Dim strWHERE As Variant Dim strEMAIL As String Dim strSUBJECT As String Dim strMSG As String If Me.lstEMAIL.ItemsSelected.Count = 0 Then MsgBox "You must select at least destination" Exit Sub End If strWHERE = strWHERE & lstEMAIL.Column(0, Item) strSUBJECT = strSUBJECT & lstEMAIL.Column(1, Item) strMSG = strMSG & lstEMAIL.Column(2, Item) ' start up Lotus Notes and get object handle passwords and ID Set s = CreateObject("Notes.NotesSession") Server = s.GETENVIRONMENTSTRING("MailServer", True) Database = s.GETENVIRONMENTSTRING("MailFile", True) Set db = s.GETDATABASE(Server, Database) On Error GoTo ErrorLogon ' See if user is logged on yet; ' if not, the error handler will kick in! Set Doc = db.CREATEDOCUMENT On Error GoTo 0 Doc.Form = "Memo" Doc.Importance = "1" '(WHERE 1=URGENT, 2= NORMAL, 3=FYI) 'Send an EMail to Doc.SENDTO = (strWHERE) 'SENDS A RETURN RECIEPT 'doc.RETURNRECIEPT = "1" Doc.Subject = strSUBJECT ' this will build the text part of your mail message Set rtItem = Doc.CREATERICHTEXTITEM("Body") Call rtItem.APPENDTEXT(strMSG) Call rtItem.ADDNEWLINE(1) 'Attach a document! 'Call rtItem.embedobject(1454, "", Attachment) '' set all object handles to nothing to release memory Call Doc.send(False) 'Make sure this parameter stays false Set Doc = Nothing Set db = Nothing Set s = Nothing Set rtItem = Nothing MsgBox "Mail has been sent!", vbInformation Exit Sub ErrorLogon: If Err.Number = 7063 Then MsgBox "Please login to Lotus Notes first!", vbCritical Set Doc = Nothing Set s = Nothing Set rtItem = Nothing Exit Sub Else strError = "An Error has occurred on your system:" & vbCrLf strError = strError & "Err. Number: " & Err.Number & vbCrLf strError = strError & "Description: " & Err.Description MsgBox strError, vbCritical Set Doc = Nothing Set s = Nothing Set rtItem = Nothing Exit Sub End If End Sub
I have bolded an instruction above, is this the way to include an attachment?
-
WSpatt
AskWoody LoungerJuly 10, 2004 at 9:39 pm #848673Can someone tell me how to send an attachment with the code that is used to send an email in this database. The following code comes from that database.
Private Sub cmdSEND_Click() Dim s As Object Dim db As Object Dim Doc As Object Dim rtItem As Object Dim Server As String, Database As String Dim strError As String Dim Item As String Dim strWHERE As Variant Dim strEMAIL As String Dim strSUBJECT As String Dim strMSG As String If Me.lstEMAIL.ItemsSelected.Count = 0 Then MsgBox "You must select at least destination" Exit Sub End If strWHERE = strWHERE & lstEMAIL.Column(0, Item) strSUBJECT = strSUBJECT & lstEMAIL.Column(1, Item) strMSG = strMSG & lstEMAIL.Column(2, Item) ' start up Lotus Notes and get object handle passwords and ID Set s = CreateObject("Notes.NotesSession") Server = s.GETENVIRONMENTSTRING("MailServer", True) Database = s.GETENVIRONMENTSTRING("MailFile", True) Set db = s.GETDATABASE(Server, Database) On Error GoTo ErrorLogon ' See if user is logged on yet; ' if not, the error handler will kick in! Set Doc = db.CREATEDOCUMENT On Error GoTo 0 Doc.Form = "Memo" Doc.Importance = "1" '(WHERE 1=URGENT, 2= NORMAL, 3=FYI) 'Send an EMail to Doc.SENDTO = (strWHERE) 'SENDS A RETURN RECIEPT 'doc.RETURNRECIEPT = "1" Doc.Subject = strSUBJECT ' this will build the text part of your mail message Set rtItem = Doc.CREATERICHTEXTITEM("Body") Call rtItem.APPENDTEXT(strMSG) Call rtItem.ADDNEWLINE(1) 'Attach a document! 'Call rtItem.embedobject(1454, "", Attachment) '' set all object handles to nothing to release memory Call Doc.send(False) 'Make sure this parameter stays false Set Doc = Nothing Set db = Nothing Set s = Nothing Set rtItem = Nothing MsgBox "Mail has been sent!", vbInformation Exit Sub ErrorLogon: If Err.Number = 7063 Then MsgBox "Please login to Lotus Notes first!", vbCritical Set Doc = Nothing Set s = Nothing Set rtItem = Nothing Exit Sub Else strError = "An Error has occurred on your system:" & vbCrLf strError = strError & "Err. Number: " & Err.Number & vbCrLf strError = strError & "Description: " & Err.Description MsgBox strError, vbCritical Set Doc = Nothing Set s = Nothing Set rtItem = Nothing Exit Sub End If End Sub
I have bolded an instruction above, is this the way to include an attachment?
-
WSpatt
AskWoody Lounger -
WSpatt
AskWoody Lounger -
WSready4data
AskWoody LoungerJuly 16, 2004 at 10:16 am #852051Pat here is the code to send an attachment.
Function SendLotus(Attachment) ‘sends an email with an attachment
Dim S As Object
Dim db As Object
Dim doc As Object
Dim rtItem As Object
Dim Server As String, Database As String
Dim strError As String‘ start up Lotus Notes and get object handle
Set S = CreateObject(“Notes.NotesSession”)
Server = S.GETENVIRONMENTSTRING(“MailServer”, True)
Database = S.GETENVIRONMENTSTRING(“MailFile”, True)
Set db = S.GETDATABASE(Server, Database)On Error GoTo ErrorLogon
‘ See if user is logged on yet;
‘ if not, the error handler will kick in!
Set doc = db.CREATEDOCUMENT
On Error GoTo 0doc.Form = “Memo”
doc.Importance = “1” ‘(WHERE 1=URGENT, 2= NORMAL, 3=FYI)‘Send an EMail to
doc.SENDTO = (“email@address.com”) ‘the address you want to send to
‘SENDS A RETURN RECIEPT
‘doc.RETURNRECIEPT = “1”
doc.Subject = “Type your subject line here”‘ this will build the text part of your mail message
Set rtItem = doc.CREATERICHTEXTITEM(“Body”)
Call rtItem.APPENDTEXT(“Type the body of your email here”)
Call rtItem.ADDNEWLINE(1)‘Attach a document!
Call rtItem.EMBEDOBJECT(1454, “”, Attachment)Call doc.send(False) ‘Make sure this parameter stays false
‘ set all object handles to nothing to release memory
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingMsgBox “Mail has been sent!”, vbInformation
Exit Function
ErrorLogon:
If Err.NUMBER = 7063 Then
MsgBox “Please login to Lotus Notes first!”, vbCritical
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingExit Function
Else
strError = “An Error has occurred on your system:” & vbCrLf
strError = strError & “Err. Number: ” & Err.NUMBER & vbCrLf
strError = strError & “Description: ” & Err.Description
MsgBox strError, vbCritical
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingExit Function
End IfEnd Function
-
WSpatt
AskWoody Lounger -
WSready4data
AskWoody Lounger -
WSpatt
AskWoody Lounger -
WSpatt
AskWoody Lounger -
WSpatt
AskWoody Lounger -
WSready4data
AskWoody LoungerJuly 16, 2004 at 10:16 am #852052Pat here is the code to send an attachment.
Function SendLotus(Attachment) ‘sends an email with an attachment
Dim S As Object
Dim db As Object
Dim doc As Object
Dim rtItem As Object
Dim Server As String, Database As String
Dim strError As String‘ start up Lotus Notes and get object handle
Set S = CreateObject(“Notes.NotesSession”)
Server = S.GETENVIRONMENTSTRING(“MailServer”, True)
Database = S.GETENVIRONMENTSTRING(“MailFile”, True)
Set db = S.GETDATABASE(Server, Database)On Error GoTo ErrorLogon
‘ See if user is logged on yet;
‘ if not, the error handler will kick in!
Set doc = db.CREATEDOCUMENT
On Error GoTo 0doc.Form = “Memo”
doc.Importance = “1” ‘(WHERE 1=URGENT, 2= NORMAL, 3=FYI)‘Send an EMail to
doc.SENDTO = (“email@address.com”) ‘the address you want to send to
‘SENDS A RETURN RECIEPT
‘doc.RETURNRECIEPT = “1”
doc.Subject = “Type your subject line here”‘ this will build the text part of your mail message
Set rtItem = doc.CREATERICHTEXTITEM(“Body”)
Call rtItem.APPENDTEXT(“Type the body of your email here”)
Call rtItem.ADDNEWLINE(1)‘Attach a document!
Call rtItem.EMBEDOBJECT(1454, “”, Attachment)Call doc.send(False) ‘Make sure this parameter stays false
‘ set all object handles to nothing to release memory
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingMsgBox “Mail has been sent!”, vbInformation
Exit Function
ErrorLogon:
If Err.NUMBER = 7063 Then
MsgBox “Please login to Lotus Notes first!”, vbCritical
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingExit Function
Else
strError = “An Error has occurred on your system:” & vbCrLf
strError = strError & “Err. Number: ” & Err.NUMBER & vbCrLf
strError = strError & “Description: ” & Err.Description
MsgBox strError, vbCritical
Set doc = Nothing
Set db = Nothing
Set S = Nothing
Set rtItem = NothingExit Function
End IfEnd Function
-
WSMarkD
AskWoody LoungerJuly 16, 2004 at 10:48 pm #852417If you plan to do a lot of work automating Lotus Notes from Access/VBA, recommend take a look at this previous thread:
Re: Mail via Lotus Notes (Access 2000/xp)
This post has link to the IBM Lotus Notes site:
Lotus Documentation – Domino and Notes Toolkit for COM Guide
If you check this site, you’ll find a link to download the Notes Toolkit for COM Guide in compiled HTML (.CHM) help file format. In simple terms, “COM” (as in “COM Automation”) means that Lotus Notes can be automated using a COM-aware programming language such as VB/VBA. The guide provides code examples in both VB and VB Script, a description of the Domino/Notes object model, and much more useful information. If you intend to work further with Lotus Notes in VBA, recommend download this guide – don’t think your VBA “Help” files cover this stuff….
HTH
-
WSpatt
AskWoody Lounger -
WSpatt
AskWoody Lounger -
WSMarkD
AskWoody LoungerJuly 16, 2004 at 10:48 pm #852418If you plan to do a lot of work automating Lotus Notes from Access/VBA, recommend take a look at this previous thread:
Re: Mail via Lotus Notes (Access 2000/xp)
This post has link to the IBM Lotus Notes site:
Lotus Documentation – Domino and Notes Toolkit for COM Guide
If you check this site, you’ll find a link to download the Notes Toolkit for COM Guide in compiled HTML (.CHM) help file format. In simple terms, “COM” (as in “COM Automation”) means that Lotus Notes can be automated using a COM-aware programming language such as VB/VBA. The guide provides code examples in both VB and VB Script, a description of the Domino/Notes object model, and much more useful information. If you intend to work further with Lotus Notes in VBA, recommend download this guide – don’t think your VBA “Help” files cover this stuff….
HTH
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
184 MILLION Passwords on FBook, Google, MS & Netflix hacked/leaked
by
ClearThunder
1 hour, 45 minutes ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
2 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
4 hours, 46 minutes ago -
Windows Update orchestration platform to update all software
by
Alex5723
9 hours, 19 minutes ago -
May preview updates
by
Susan Bradley
10 hours, 57 minutes ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
11 hours, 5 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
1 hour, 31 minutes ago -
KB5058379 / KB 5061768 Failures
by
crown
2 hours, 58 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 hour, 6 minutes ago -
At last – installation of 24H2
by
Botswana12
1 day ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
5 hours, 42 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
1 day, 13 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
1 day, 6 hours ago -
Limited account permission error related to Windows Update
by
gtd12345
2 days, 2 hours ago -
Another test post
by
gtd12345
2 days, 2 hours ago -
Connect to someone else computer
by
wadeer
1 day, 21 hours ago -
Limit on User names?
by
CWBillow
2 days ago -
Choose the right apps for traveling
by
Peter Deegan
1 day, 14 hours ago -
BitLocker rears its head
by
Susan Bradley
22 hours, 4 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
21 hours ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 16 hours ago -
A smarter, simpler Firefox address bar
by
Alex5723
2 days, 12 hours ago -
Woody
by
Scott
2 days, 22 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
21 hours, 40 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
3 days, 12 hours ago -
MS Office 365 Home on MAC
by
MickIver
3 days, 6 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
4 days, 2 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
21 hours, 25 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 21 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.