![]() |
Command Button - Macro to print to pdf, then send pdf to email.
I have a command button in my Excel spreadsheet where it will look at the
email address typed into a specific field and email the excel file to that email address. What I want to do is when I push the button, First have the page print to a pdf, then send only the pdf file to the email address specified. How do I add in the step of printing to a pdf. Thanks in advance, Travis |
Answer: Command Button - Macro to print to pdf, then send pdf to email.
Hi Travis,
To add the step of printing to a PDF before sending the email, you can use the "ExportAsFixedFormat" method in VBA. Here are the steps to do this:
Now, when you click the button, it will print the active sheet to a PDF file and then send the PDF file as an attachment to the email address specified in the cell you have specified. |
Command Button - Macro to print to pdf, then send pdf to email.
Hi Travis
Code on my page for excel 2007 and a link to Ken's site for older versions http://www.rondebruin.nl/pdf.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Tdahlman" wrote in message ... I have a command button in my Excel spreadsheet where it will look at the email address typed into a specific field and email the excel file to that email address. What I want to do is when I push the button, First have the page print to a pdf, then send only the pdf file to the email address specified. How do I add in the step of printing to a pdf. Thanks in advance, Travis |
All times are GMT +1. The time now is 11:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com