Hi all,
I have a module which creates a .snp in a pre-defined location and emails that file through our Lotus Notes email system. We are using Lotus Notes v4.5 and Access 2000 on Windows 2000 machines. Code is attached below in red
I have three questions:
1. I'm having difficulty getting it to send the email to more than one person. The code was borrowed from this forum and I was wondering if anyone had any insight how to CC: someone on the email. In the borrowed code there is a field for "CC:" but when I place someones name there, the email does not get CC'ed to that person.
2. The code saves the document as a draft in the senders email account, can I switch this to be saved in the "sent" folder.
3. When the email arrives at the destination inbox, it is marked read already, can I have it marked unread?
Thanks!
Andy
[red]
Public Function EmailUsers()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf1 As Object
Dim eo1 As Object
Dim vComplaint As String
Dim vFileName As String
vFileName = "S:\Complaint Database\ComplaintFiles\" & Forms![frm_Complaint_Form]![Complaint #:] & ".snp"
vComplaint = Forms![frm_Complaint_Form]![Complaint #:]
DoCmd.Hourglass True
'Start new Lotus Notes Session
Set session = CreateObject("Notes.NotesSession"
Set db = session.GETDATABASE("", ""
'Open Mail Database. This will prompt for a password if not already open-
'For full automation, Notes should already be open.
Call db.OPENMAIL
'Make new document
Set doc = db.CREATEDOCUMENT
'Build e-mail
With doc
.Form = "Memo"
.SAVEMESSAGEONSEND = True
.SendTo = vSendList
.cc = "Andrew J Michalski/IL/Unitedmail@Unitedmail"
.Subject = "New Complaint # " & vComplaint
Set rtf1 = .CREATERICHTEXTITEM(doc, "Body"
'Import Text
Call rtf1.AppendText("New Complaint Created. See attached form for further information. " & Variable & vbCrLf & vbCrLf)
'Attach Files
Set eo1 = rtf1.EMBEDOBJECT(1454, "", vFileName)
'Send Mail
Call .SEND(True)
MsgBox "An Email has been sent to QI and Support Staff informing them of this complaint. Thank you.", vbInformation, "Confirmation"
DoCmd.Hourglass False
End With
'Deallocate Objects
Set rtf1 = Nothing
Set doc = Nothing
Set session = Nothing
End Function
I have a module which creates a .snp in a pre-defined location and emails that file through our Lotus Notes email system. We are using Lotus Notes v4.5 and Access 2000 on Windows 2000 machines. Code is attached below in red
I have three questions:
1. I'm having difficulty getting it to send the email to more than one person. The code was borrowed from this forum and I was wondering if anyone had any insight how to CC: someone on the email. In the borrowed code there is a field for "CC:" but when I place someones name there, the email does not get CC'ed to that person.
2. The code saves the document as a draft in the senders email account, can I switch this to be saved in the "sent" folder.
3. When the email arrives at the destination inbox, it is marked read already, can I have it marked unread?
Thanks!
Andy
[red]
Public Function EmailUsers()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf1 As Object
Dim eo1 As Object
Dim vComplaint As String
Dim vFileName As String
vFileName = "S:\Complaint Database\ComplaintFiles\" & Forms![frm_Complaint_Form]![Complaint #:] & ".snp"
vComplaint = Forms![frm_Complaint_Form]![Complaint #:]
DoCmd.Hourglass True
'Start new Lotus Notes Session
Set session = CreateObject("Notes.NotesSession"
Set db = session.GETDATABASE("", ""
'Open Mail Database. This will prompt for a password if not already open-
'For full automation, Notes should already be open.
Call db.OPENMAIL
'Make new document
Set doc = db.CREATEDOCUMENT
'Build e-mail
With doc
.Form = "Memo"
.SAVEMESSAGEONSEND = True
.SendTo = vSendList
.cc = "Andrew J Michalski/IL/Unitedmail@Unitedmail"
.Subject = "New Complaint # " & vComplaint
Set rtf1 = .CREATERICHTEXTITEM(doc, "Body"
'Import Text
Call rtf1.AppendText("New Complaint Created. See attached form for further information. " & Variable & vbCrLf & vbCrLf)
'Attach Files
Set eo1 = rtf1.EMBEDOBJECT(1454, "", vFileName)
'Send Mail
Call .SEND(True)
MsgBox "An Email has been sent to QI and Support Staff informing them of this complaint. Thank you.", vbInformation, "Confirmation"
DoCmd.Hourglass False
End With
'Deallocate Objects
Set rtf1 = Nothing
Set doc = Nothing
Set session = Nothing
End Function