O
Opal
I have a database that tracks repair data on an hourly
basis. I want to be able to email a report to users
directly from the database. However, the email
program in use is Lotus notes.
I have successfully sent emails from my home
computer using "Thunderbird" using the following:
Private Sub cmdEmailHourly_Click()
On Error GoTo Err_cmdEmailHourly_Click
Dim stDocName As String
Dim stTo As String
stDocName = "rptHourlyStatus"
stTo = "(e-mail address removed)"
DoCmd.SendObject acReport, stDocName, , stTo, , , "Hourly Status
Report"
Exit_cmdEmailHourly_Click:
Exit Sub
Err_cmdEmailHourly_Click:
MsgBox Err.Description
Resume Exit_cmdEmailHourly_Click
End Sub
but get an error
message at work when attempting to email from there
using Lotus Notes. I found the following code
while searching for answers but do not know if it
can be "tweaked" enough to work. Is anyone
familiar with this process?
Private Sub cmdEmailHourly_Click()
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Rem make new mail message
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", "(e-mail address removed)")
Call notesdoc.replaceitemvalue("Subject", "Hourly Offline Report")
Set notesrtf = notesdoc.createrichtextitem("rptHourlyStatus")
Call notesrtf.appendtext("Hourly Report")
Call notesrtf.addnewline(2)
Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.embedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing
End Sub
I fear I may have to get my IT Group involved and that could
delay the implementation by several months, so I am hoping
to develop a work around before that.
basis. I want to be able to email a report to users
directly from the database. However, the email
program in use is Lotus notes.
I have successfully sent emails from my home
computer using "Thunderbird" using the following:
Private Sub cmdEmailHourly_Click()
On Error GoTo Err_cmdEmailHourly_Click
Dim stDocName As String
Dim stTo As String
stDocName = "rptHourlyStatus"
stTo = "(e-mail address removed)"
DoCmd.SendObject acReport, stDocName, , stTo, , , "Hourly Status
Report"
Exit_cmdEmailHourly_Click:
Exit Sub
Err_cmdEmailHourly_Click:
MsgBox Err.Description
Resume Exit_cmdEmailHourly_Click
End Sub
but get an error
message at work when attempting to email from there
using Lotus Notes. I found the following code
while searching for answers but do not know if it
can be "tweaked" enough to work. Is anyone
familiar with this process?
Private Sub cmdEmailHourly_Click()
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Rem make new mail message
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", "(e-mail address removed)")
Call notesdoc.replaceitemvalue("Subject", "Hourly Offline Report")
Set notesrtf = notesdoc.createrichtextitem("rptHourlyStatus")
Call notesrtf.appendtext("Hourly Report")
Call notesrtf.addnewline(2)
Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.embedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing
End Sub
I fear I may have to get my IT Group involved and that could
delay the implementation by several months, so I am hoping
to develop a work around before that.