+ Reply to Thread
Results 1 to 4 of 4

Macro to send an attachment via Outlook from excel

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Unhappy Macro to send an attachment via Outlook from excel

    Hi


    I found a macro which I would like to modify a bit:

    (Sub mailOutlook()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim stFname As String
    Dim cell As Range

    For Each cell In Range("A1:A5")
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.createitem(0)
    With OutMail
    .To = cell
    .Subject = Range("C1")
    .Body = Range("C2")
    .display
    '.send (Optional)
    End With
    Next cell

    Set OutMail = Nothing
    Set OutApp = Nothing
    End Su)

    Is there ability to add code in this to send the exact attachment I'm in now? So not only the email but with a file.

    Thank you a lot for you support,
    Andy
    Last edited by dobracik; 05-02-2014 at 03:23 AM. Reason: brakets

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Macro to send an attachment via Outlook from excel

    Hi Andy,

    A small tip, always use the code tags around your code (the "#") option immediately above.

    To your question, I recommend the wonderful site from Ron de Bruin (http://www.rondebruin.nl/) where you will see a number of options for dealing with emails in all forms

    I have used them myself and know they work

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Re: Macro to send an attachment via Outlook from excel

    Hi

    Thanks for the tip. I was looking into that page and just need few words to my code. As mine is already working

    Thanks,
    Andy

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro to send an attachment via Outlook from excel

    hi,
    Jmac told you to use code tags around yr code, it's a forum rule, it's easy to read it, etc, then he offers you a site with examples. also you can search here and you'll find plenty of examples of what you're looking for!
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

+ 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. [SOLVED] VBA code to send excel attachment through outlook 2010
    By Liz_Biz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 08:33 AM
  2. [SOLVED] Macro to send a pdf attachment via outlook from excel
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2013, 02:17 PM
  3. [SOLVED] VBA Macro to print to Pdf format and place as attachment in Outlook (Excel & Outlook 2007)
    By Webman1012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2013, 01:25 PM
  4. Excel to send email via Outlook (attachment)
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2012, 07:01 AM
  5. Send Excel attachment, but wait till Outlook closes
    By thepython in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2006, 05:30 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