+ Reply to Thread
Results 1 to 14 of 14

Save as PDF and email in outlook

  1. #1
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Save as PDF and email in outlook

    Hi
    I am looking for a VBA code that will save an excel file in a specified folder as a PDF based on cell values and then open an email with pre defined email addresses and subject/body based on text/cell values. Does such code exist?
    Thanks
    Anthony

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Save as PDF and email in outlook

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.

    -


    See clip
    To add a file to a post

  3. #3
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    Thanks - see attached example.
    Essentially I would like the file to be named and saved as: Collection/Return Request - (Cell C12 value) - (Cell C7 value)

    Then click the send request to email button will attach the PDF to the email...

    And then then the subject of the email to be the same as the file name.

    The body of the email to say:

    Please find attached return request form.

    Regards
    (Cell C8) value)

    Thanks
    Anthony
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    Thanks - see attached example.
    Essentially I would like the file to be named and saved as: Collection/Return Request - (Cell C12 value) - (Cell C7 value)

    Then click the send request to email button will attach the PDF to the email...

    And then then the subject of the email to be the same as the file name.

    The body of the email to say:

    Please find attached return request form.

    Regards
    (Cell C8) value)

    Thanks
    Anthony

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Save as PDF and email in outlook

    For starters.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    That is spot on, the only other thing I would need is to save the PDF in a specific folder on a shared drive. Could this be added?
    Thanks again
    Last edited by davesexcel; 02-21-2019 at 06:37 AM.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Save as PDF and email in outlook

    Please Login or Register  to view this content.
    Try replacing the red part with the shared drive path.

  8. #8
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    Thanks again, whereabouts in the string should this go?

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Save as PDF and email in outlook

    As I said replace the red part.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    I meant where in the bit below it should go...?

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Save as PDF and email in outlook

    Please Login or Register  to view this content.
    Last edited by banaanas; 02-21-2019 at 07:36 AM. Reason: Added missing points
    Tuomas "Banaanas" Savonius
    Trying to give back now when I actually can do some VBA

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Save as PDF and email in outlook

    And also.
    Please Login or Register  to view this content.
    Or in 1 go.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 02-21-2019 at 07:32 AM.

  13. #13
    Registered User
    Join Date
    02-19-2019
    Location
    london
    MS-Off Ver
    2018
    Posts
    8

    Re: Save as PDF and email in outlook

    Perfect thanks for all your help on this!!!

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Save as PDF and email in outlook

    Glad to help and thanks for rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Check if email is unread in outlook then save attachment to folder
    By sonyat810 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2018, 03:10 PM
  2. [SOLVED] How to get outlook email attachment using excel vba and save it in a specified folder
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2016, 08:34 PM
  3. Script to save as PDF and Email through Outlook
    By tjhess4733 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2016, 07:18 PM
  4. [SOLVED] VBA - Save, and Embed in Email (Outlook)
    By jlo33 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-19-2013, 10:10 AM
  5. Save range and send as outlook email
    By hejbeiter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2012, 12:50 PM
  6. VB to save word doc with a filename just copied from an Outlook email
    By chrisvelnet in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2011, 09:28 AM
  7. save email in Outlook
    By Jessebraswell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2009, 10:27 AM

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