+ Reply to Thread
Results 1 to 19 of 19

Print email to pdf with recipients' names

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Print email to pdf with recipients' names

    Hi, i have this piece of code for printing email to pdf from a specific folder in outlook, but the recipients names are missing at the top of the page. Anyone knows whats wrong?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    Can anyone help please?

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Try saving the email as a mht file then opening with Word and exporting.

    Please Login or Register  to view this content.
    Last edited by ByteMarks; 09-07-2023 at 04:39 AM.

  4. #4
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    Hi ByteMarks, i tried your code but nothing seems to be happening. The only thing i changed was the folder name from Pre Alert responses to my folder name. Could you please advise?

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Have you tried stepping through? It should create an .mht file in temporary folder, open it with Word and then saving that as a pdf to whatever folderPath is.

  6. #6
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    I set the folderpath to my desktop and i changed the code to have the .mht file save on my desktop as well. I can see the .mht file being created, but no pdf. I changed the word visible part to true, but it did not open the word app. i think this is where something went wrong?

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Try adding the line in red and see if Word opens.



    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    Word opened with that line added, but still no pdf

  9. #9
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Maybe it's Word 2003 that can't convert to pdf? If you can't manually save as a pdf, then that would seem to be the case.

  10. #10
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    I'm using microsoft 365. is there any other way?

  11. #11
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    I don't know of another way, although there may be one.

    Does Word open the mht file after this line?
    Please Login or Register  to view this content.
    If you stop the code after the line above leaving the document open, can you manually save as a pdf?

    Is folderPath & Filename & ".pdf" a valid file path?

  12. #12
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    when i tried to save as pdf manually, this message appears. Is this the cause of the pdf not appearing? if so, how do i solve it?
    Attached Images Attached Images

  13. #13
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Maybe the mht isn't supported. Can you save it in docx format?

  14. #14
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    it allows me to save as docx, and i need to apply a sensitivity label just before it saves. Can this be done in the macro?

  15. #15
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    It seems it should be a property you can set, but sensitivity labels are disabled for me so I'm unable to test.

    Once the docx is saved manually with the label, can you convert it to pdf?

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,279

    Re: Print email to pdf with recipients' names

    I suspect you need a business or school account, rather than a personal account.

    https://learn.microsoft.com/en-us/pu...itivity-labels
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  17. #17
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    yes, i can save as pdf after i apply the label and save as a word docx. How about i use a word template that has the label applied first? how do i write the code to open that word template, populate the email information in it, and save as pdf?

  18. #18
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: Print email to pdf with recipients' names

    I got it working after many tries. Thanks ByteMarks for your help. heres the code

    Please Login or Register  to view this content.

  19. #19
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,000

    Re: Print email to pdf with recipients' names

    Great idea! Thanks for sharing.

+ 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] Macro to populate save & send email recipients using sheet names
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2015, 07:57 AM
  2. [SOLVED] How to send Lotus email with VBA to more recipients and also to more copy recipients
    By Sachy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-20-2013, 03:23 PM
  3. [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
  4. EMAIL List of recipients
    By KevBotes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 01:41 PM
  5. [SOLVED] Email multiple recipients
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2009, 09:25 AM
  6. email one sheet to many recipients based on email list
    By cdl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2008, 11:12 AM
  7. 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