Send Email Attachment without specific path

a10scourt

Registered User.
Local time
Today, 09:51
Joined
Jul 20, 2010
Messages
17
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:
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?
 
If you want to email a file, the file attachment has to come from a fixed location.
 
I think I helped with that code, and my assumption was that Me.Article held a path to the attachment, not the attachment itself. Is that not the case?
 

Users who are viewing this thread

Back
Top Bottom