docmd.SendObject

lesg01stn

New member
Local time
Today, 16:09
Joined
Mar 4, 2014
Messages
5
The docmd.SendObject functionality is great in that it crosses all email clients but you can only "attach" one document to the email.

I have 2 reports and a table that get converted to PDF & excel formats and the resultant three documents need to be attached to an email to be sent out.

As a result I have code that does this for me if the user has an outlook mail client... unfortunately some of the users that use my app, use Lotus Notes as their mail client. I know absolutely ZERO (:confused:) about this client and need help creating code that is similar to he following outlook code:

' #### Outlook code ####
'........................................................................................................................
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = msgSubject
.Body = msgMessage
.Attachments.Add (myPath & "ImportData.xlsx")
.Attachments.Add (myPath & "Operational PDA.pdf")
If myFlag = True Then
.Attachments.Add (myPath & "Bottler PDA.pdf")
End If
.display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing

Please help because I am now at the stage of :banghead:
 
You could use CDO code instead of Outlook automation or Lotus Notes

It doesn't matter what Mail program you are using (CDO only uses the SMTP server)

I haven't done it with Lotus Notes, but I have done it with Gmail.

See example HERE:
http://msaccesshintsandtips.ning.com/profiles/blogs/sending-google-mail-gmail-from

There are comprehensive notes available, so you should be able to suss it out yourself.

However, search the internet first, and check that it is possible to bypass lotus notes with CDO, I can't see why not, but it would be best to check first.
 
You will also need internet access.....
 
Thanks Uncle Gizmo.... However I have 2 issues as a result of my being on a work laptop... Our firewall does not allow us to access your url and more often than not we are blocked from using "internet mail" servers. At this stage it may be that I will have to build in code for the Lotus Notes users to use the docmd.sendobject functionality and force them to manually attached the remaining 2 documents, but I would really like to find the correct answer.
 
Thanks Gizmo... finally managed to solve the Lotus Notes code
 

Users who are viewing this thread

Back
Top Bottom