Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2022, 01:02 PM
bcfd_110 bcfd_110 is offline Creating a VBA Code to print then send as an email attachment Windows 10 Creating a VBA Code to print then send as an email attachment Office 2021
Novice
Creating a VBA Code to print then send as an email attachment
 
Join Date: Sep 2022
Posts: 1
bcfd_110 is on a distinguished road
Question Creating a VBA Code to print then send as an email attachment

Hello,

In am relatively inexperienced a VBA but eager to learn more. What I am trying to accomplish is create a command button at the end of a letter template in word that will not only automatically print the letter but will also save as a PDF then open a new message in outlook with said PDF as an attachment. I've been looking through the forums and have found bits and pieces of coding but I'm just not sure how to put it all together. Would anyone be willing to provide any assistance on what the coding would look like (if it's even possible to do all this)?

Thanks in advance!
Reply With Quote
  #2  
Old 09-04-2022, 01:53 PM
Logit Logit is offline Creating a VBA Code to print then send as an email attachment Windows 10 Creating a VBA Code to print then send as an email attachment Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

What you are describing is several different macros that are run, one after another.
The first macro will print your document (as you have already described); the next saves that document as a PDF and the last macro will attach the PDF to an email and send via Outlook.


Understandably it all appears to be Greek to you at this point but truly the process is rather straight forward.


Yes ... there are tons of examples for each of the macros you describe, on the internet for the taking.


If you have never written a macro before, I suggest looking at a few YouTube videos "How to write a VBA macro". Once you get the hang of that, 'google' for 'VBA print Word Doc' ... then 'google' for 'VBA Save Word as PDF'. Finally, 'google' for 'VBA Email with attachment'.


You can also look for 'VBA run several macros' so you can learn how to "call" one macro after another.


Come on back when you run into trouble ... but give it your best shot first.
Reply With Quote
Reply

Tags
email attachment, vba code



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a VBA Code to print then send as an email attachment creating HTML code for email trevorc Excel Programming 6 05-17-2021 09:29 PM
Outlook macro to check a value of a cell in an attachment and send an email based on that value ketangarg86 Outlook 13 03-25-2015 07:11 AM
Creating a VBA Code to print then send as an email attachment VBL code for automatic attachment of file into email DrLoveday1 Outlook 1 04-12-2013 05:36 AM
Creating a VBA Code to print then send as an email attachment Command button - save in temp folder and send email with attachment bigbird69 Word VBA 13 11-18-2012 10:06 PM
Creating a VBA Code to print then send as an email attachment email as pdf attachment - subject line and attachment named after mail merge Nexus Mail Merge 12 04-13-2011 11:34 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft