Hey everyone! So I was wondering if there was a way to send an attachment in an email without having to use a specific path (i.e. each record has a different attachment). Below is my code:
The code runs fine if I put in a file path, but I need to use me.Articles (articles being the attachment tied to the record) or something similar so the right record goes with each one.
Any thoughts on this?
Code:
Private Sub SendEmail_Click()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Dim objAttach As Outlook.attachment
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
Set objAttach = objMail.Attachments.Add(Me.Article)
objMail.To = ";"
objMail.Subject = "Please Read this article"
objMail.Body = Me.Title
objMail.Display
End Sub
The code runs fine if I put in a file path, but I need to use me.Articles (articles being the attachment tied to the record) or something similar so the right record goes with each one.
Any thoughts on this?