Quote Originally Posted by OBP View Post
Hi, the docmd object is not very good at sending attachments.
Here is the code that I used, it should have Error Trapping added,

Dim objOutlook  As New Outlook.Application  ' outlook object
    Dim objMessage  As MailItem, strAttach As String    ' outlook mail message
   Dim Subject As String, Body As String, EmailAddress As String
    EmailAddress = Me.EmailAddress
    strAttach = Me.Attachment
            Set objMessage = objOutlook.CreateItem(olMailItem)
            With objMessage
                .To = EmailAddress
                .Subject = "Test Send"
                .Body = "This is a Test"
                .Attachments.Add strAttach
                .DisplayName = "Joe Bloggs"
                .Send
            End With
    Set objOutlook = Nothing
    Set objMessage = Nothing
I've tried adding your code but it bumps up against a
User_Defined type not defined
error. Am I missing a reference library? Do I need to declare the Outlook.Application elsewhere?
I am using Access 365.