To create an email and add attachment(s)...
Code:Option Explicit Private Sub cmdSend_Click() Dim oOutlook As Outlook.Application Dim olEMail As Outlook.MailItem Dim olAttach As Outlook.Attachments Dim sAttach As String Set oOutlook = New Outlook.Application Set olEMail = oOutlook.CreateItem(olMailItem) olEMail.To = "RobDog888@???.com" sAttach = App.Path & "\" & "Test.txt" Set olAttach = olEMail.Attachments olAttach.Add sAttach, 1, 1, "Test.txt" olEMail.Body = "RobDog888's email attachment example." olEMail.Send End Sub





Reply With Quote