Hi Forum, access 2010
I use two email methods.
Outlook OM
eg
The other method is DoCmd.SendObject
eg
With Outlook OM we can attach a file but the system does not pickup an email failing to be sent.
With SendObject, I can not see how to attach a .pdf file.
The code does pickup a failure of an email to be sent..
Is it possible to attach files with SendObject ?
I understand Outlook OM can beaware of an email failure to be sent if you have additional code to look for outlook error messages.
On another issue, can DoCmd.SendObject be the method to transfer data from one database to a remote database ??
If we have a tblAudit which records all changes to our database can DoCmd.SendObject email this table to a remote database and allow the two databses to then have the same records ?
Appreciate any advice
I use two email methods.
Outlook OM
eg
Code:
'Create variables for Outlook Mail
Dim MyOutlook As Outlook.Application 'An Outlook Application
Dim MyMail As Outlook.MailItem 'An Outlook Mail Item
'Open Outlook
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
MyMail.To = varTo
MyMail.CC = "Loans"
MyMail.Subject = stSubject
MyMail.Body = stText
' MyMail.Attachments.Add "W:\Attachments\" & FullName & " Loan Statement " & TeamMember & ".pdf", olByValue, 1, "Statement"
MyMail.Importance = MailImportance
' MyMail.Send
MyMail.Display
Set MyOutlook = Nothing
Set MyMail = Nothing
The other method is DoCmd.SendObject
eg
Code:
DoCmd.SendObject , , acFormatTXT, varTo, "Loans", , stSubject, stText, -1
With Outlook OM we can attach a file but the system does not pickup an email failing to be sent.
With SendObject, I can not see how to attach a .pdf file.
The code does pickup a failure of an email to be sent..
Is it possible to attach files with SendObject ?

I understand Outlook OM can beaware of an email failure to be sent if you have additional code to look for outlook error messages.
On another issue, can DoCmd.SendObject be the method to transfer data from one database to a remote database ??

If we have a tblAudit which records all changes to our database can DoCmd.SendObject email this table to a remote database and allow the two databses to then have the same records ?

Appreciate any advice
