+ Reply to Thread
Results 1 to 2 of 2

Email (outlook) recipients attaching specific file name.

Hybrid View

  1. #1
    Registered User
    Join Date
    11-12-2014
    Location
    Newcastle, England
    MS-Off Ver
    2010
    Posts
    54

    Email (outlook) recipients attaching specific file name.

    Please find attached a sample file which I'm wondering if it's possible to run a macro from to email the specified recipients and attach the filename. It wouldn't matter that different files were emailed to the same recipient separately.

    The files that this sample refers to are all saved in the same directory.

    Your help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Email (outlook) recipients attaching specific file name.

    Yes, it is possible. Here is some code to get you started. This sends the active sheet as a pdf using Outlook.

    Sub SendWorkSheetToPDF()
    Dim Wb As Workbook
    Dim FileName As String
    Dim OutlookApp As Object
    Dim OutlookMail As Object
    On Error Resume Next
    Set Wb = Application.ActiveWorkbook
    FileName = "full path of file goes here"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)
    With OutlookMail
        .Subject = "subject"
        .To = "someone@somesite.com"
        .Attachments.Add FileName
        .Display
    End With
    Kill FileName
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Attaching data from a worksheet using VBA to an email through Outlook
    By AcoloyteAndrew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2014, 11:07 PM
  2. Outlook macro when attaching a document to an email
    By zarake in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2013, 07:41 PM
  3. Macro for attaching files into Outlook email - 95% complete but....
    By heatwave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 01:30 AM
  4. [SOLVED] Print Macro to email PDFs of specific pages of a workbook to specific recipients
    By mike_vr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 12:34 PM
  5. Replies: 1
    Last Post: 01-13-2005, 02:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1