+ Reply to Thread
Results 1 to 13 of 13

Macro to create a pdf and attach to an email (Outlook)

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    6

    Macro to create a pdf and attach to an email (Outlook)

    I need to create a pdf that will be attached to an email with the click of a button.

    Essentially I have a report that I must send out every day at the same time. I would like this button to print a pdf of my "Report" sheet and attach it to an email within Outlook.

    I believe this is where it may get tricky:
    1) I would like the pdf to be saved as "AB Power Marks, Today()"
    2) I would like the subject of the email to match the name of the pdf: ""AB Power Marks, Today()"
    3) I would like the body to read as:
    "Hello,

    These are the AB power marks as 12:30 MST for Today()

    If you have any questions or concerns regarding any of the information provided on the sheet please contact me. All of my contact details can be found below.

    Have a good day!

    Regards,"

    Attached is a copy of my spreadsheet. I would appreciate any help.

    I have scoped out the forums and you seem to be very knowledgeable in this subject.

    Thank you!

    Test.xlsx

  2. #2
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jsedore

    Here's a quick go of it...see if it works for you.
    Attached Files Attached Files
    John

    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.

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jaslake,

    That works great!

    I have 2 things that I would request to have changed though:
    1) can the date (today) be changed to display dd-mmm-yy? exclude the Day name ie Wednesday
    2) can the pdf be defaulted to display only 1 page?

    Thanks for your help!

  4. #4
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jsedore

    Do you want this "stuff" in the PDF?

    PDF.jpg

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jaslake

    Negative

  6. #6
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jsedore

    Try this
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jaslake

    Looks great!

    Two last things then I think its complete:

    1) default To: and CC: to blank
    2) Change button name to "Send Report"

    Thanks for all the help! I'm lost when it comes to coding stuff

  8. #8
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jsedore

    Done and Done...
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-29-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi jaslake

    You're the man! Thank you!

    I am giving you a star!

  10. #10
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    You're welcome...glad I could help. Thanks for the Rep.

  11. #11
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi John,
    I would like to do this exact same thing BUT my company uses Lotus Notes and not Outlook. How would I go about this?
    Thanks,
    Lumi

  12. #12
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,747

    Re: Macro to create a pdf and attach to an email (Outlook)

    Hi Lumi

    No clue...don't use Lotus Notes...but...you really need to start your own Thread

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  13. #13
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Macro to create a pdf and attach to an email (Outlook)

    Yes I know I know. I already started a thread and no luck :/

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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