where EMailString looks like "mailto:User Name/OU/O?Subject=An email subject"
But there are some boundaries:
* you must have Lotus Notes as default E-mail program set up in internet settings (in my case IE 6.)
* you have to manually input message body (standard RFC mailto option ?Body= does not work with Notes (it works with Outlook Express))
* you have to manually send message
I found this code on the MS Access forum on tek-tips (cant remember where exactly but a search will find it):
Hope it helps!
Klopper
Public Sub EmailWithNotes(strSendTo As String, strSubject As String, Optional strCCTo As String, _
Optional strBody As String, Optional strAttachPath As String)
Dim objSession As Object
Dim objDB As Object
Dim objDoc As Object
Dim objAttach As Object
Dim objEmbed As Object
On Error GoTo err_EmailWithNotes
' -Creates a Lotus Notes Session if there isn't one already running
Set objSession = CreateObject("Notes.NotesSession"
' -Set db to a database not yet named
Set objDB = objSession.GETDATABASE("", ""
' -Sets database to default mail database
Call objDB.OPENMAIL
' -Creates a new mail document
Set objDoc = objDB.CREATEDOCUMENT
' -Insert passed variables into mail document.
Call objDoc.REPLACEITEMVALUE("SendTo", strSendTo)
Call objDoc.REPLACEITEMVALUE("Subject", strSubject)
' -Note: This code only functions for CCing or BCCing to one addresss each.
Call objDoc.REPLACEITEMVALUE("CopyTo", strCCTo)
' -Note: This code does not leave a copy of the email that
' is being created in the sent box, so to have a copy
' BCC is used to send copy to self
Call objDoc.REPLACEITEMVALUE("BlindCopyTo", objSession.UserName)
Call objDoc.REPLACEITEMVALUE("Body", strBody)
If Not strAttachPath = "" Then
Set objAttach = objDoc.CREATERICHTEXTITEM("Attachment"
' -Note: More than one attachment can be sent, but than this code
' needs to be copied elsewhere and the following line needs to
' be executed with a new attachment path for every attachment.
Set objEmbed = objAttach.EMBEDOBJECT(1454, "", strAttachPath)
End If
' -Send new mail document
Call objDoc.SEND(False)
' -Reset objects back to nothing to clear memory
exit_EmailWithNotes:
Set objDoc = Nothing
Set objDB = Nothing
Set objSession = Nothing
Set objAttach = Nothing
Set objEmbed = Nothing
Exit Sub
err_EmailWithNotes:
MsgBox Err.Description, , Err.Number
GoTo exit_EmailWithNotes
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.