Access/Lotus Notes

  • Thread starter Thread starter jo
  • Start date Start date
J

jo

Hi guys i'm sorry to ask this question again but I can't seem to find the
answer? And I really need some help with either coding or macro. I have a
macro that does a SendObject. it does every thing i want until the report
arrives in lotus notes to be sent as an email. my problem is with lotus notes
i want the email to be sent automatically without the user having to click
send??? is this possible?? Below is the code that i have does en one know wot
is missing in th code for that final send?
plz plz help?? jo
------------------------------------------------------------
' checker_Query_overdue
'
'------------------------------------------------------------
Function checker_Query_overdue()
On Error GoTo checker_Query_overdue_Err

If (DCount("*", "OnOpenOverdue") > 0) Then
DoCmd.SendObject acReport, "OnOpenOverdue", "SnapshotFormat(*.snp)",
"(e-mail address removed)", "", "", "Gauge Control", "Gauges Overdue",
False, ""
End If
If (DCount("*", "OnOpenOverdue") = 0) Then
Beep
MsgBox "No Gauges found overdue today..", vbOKOnly, "No Gauges
found.."
End If
 
Well, sendoject puts the email in the outbox, from that point on your
dealing with Lotus Notes.

The only suggestion I can come up with is two things:

1) make sure notes email is running before they attempt the sendobject. For
example, if you not running outlook, then the email stays in the outbox
until you launch outlook and do a send receive. However, if you launch
Outlook and leave it running, and then use sendobject in ms-access, the
email does not stay in the outbox...it is sent right away. So, try/check
this issue.

2) ask in the Lotus support groups if note supports automaton. If it does,
then ask them for a windows or VB, or VBA script that shows how to send a
email with an attachment (that does not stay in the outbox). That script
should be easily adopted to run in ms-access. I would then setup code to run
the ms-access report, save report as a pdf, and then have ms-access code run
the Lotus automaton script to create the email, attach the pdf file, and
then send it.

I can post the code to save the report as a pdf file, but until you come
back with a working Lotus email script, it will not of any use to you....
 
Prior to this code.."M" is a .snp file. HTH - Bob
Set Tools - References to "Lotus Domino Objects"

Dim NotesSession As NotesSession
Dim NotesDB As NotesDatabase
Dim NotesDoc As NotesDocument
Dim TheE As NotesRichTextItem
Dim NotesDir As NotesDbDirectory
'Instantiate NotesSession
Set NotesSession = CreateObject("Lotus.NotesSession")
NotesSession.Initialize
Set NotesDir =
NotesSession.GetDbDirectory(NotesSession.GetEnvironmentString("MailServer"))
Set NotesDB = NotesDir.OpenMailDatabase
Dim sTO$, TCC(2) As String, Gog$
'Create new Notes document
'.............cboEM = "To:" -- One_EM & Two_EM = 2 "cc:"
sTO = cboEM
If Len(One_EM) > 0 Then
TCC(0) = One_EM
End If
If Len(One_EM) > 0 Then
TCC(1) = Two_EM
End If
'Ck Gog Length
If Len(One_EM) > 0 Then
Gog = One_EM
If Len(Two_EM) > 0 Then
Gog = Gog & ", " & Two_EM
End If
ElseIf Len(Two_EM) > 0 Then
Gog = Two_EM
If Len(One_EM) > 0 Then
Gog = Gog & ", " & One_EM
End If
Else
Gog = ""
End If
Set NotesDoc = NotesDB.CreateDocument
'Send to strTo and set Subject of e-mail
Call NotesDoc.ReplaceItemValue("Sendto", sTO)
If Len(Gog) > 0 Then
Call NotesDoc.ReplaceItemValue("Copyto", TCC)
End If
If GoRush = True Then 'GoRush is a Yes/No Control on the Form
Call NotesDoc.ReplaceItemValue("Subject", "RUSH - Req Snapshot")
Else
Call NotesDoc.ReplaceItemValue("Subject", "Req Snapshot")
End If
Set TheE = NotesDoc.CreateRichTextItem("AD")
Dim RT As NotesRichTextItem
Set RT = NotesDoc.CreateRichTextItem("Body")
RT.AppendText ("Requisition Attached")
RT.AddNewLine (1)
If Not IsNull(LexNote) Then RT.AppendText (LexNote)
Call TheE.EmbedObject(1454, "", M, "")
NotesDoc.SaveMessageOnSend = True
Call NotesDoc.ReplaceItemValue("SendTo", sTO)
Call NotesDoc.Send(False)
Set NotesSession = Nothing
MsgBox "Email sent.", vbOKOnly + vbInformation, "Email Sent..."
End If
 
Back
Top