Thread: [Solved] vba code
View Single Post
 
Old 08-31-2017, 05:22 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,366
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can't send the attachment without first saving the file. Accordingly, you could save & send the full file, then delete the 2nd page and re-save. However, your code doesn't appear to actually send the email, so you'd need to save the 2-page email-attachment version with a different name (or, at least, in a different folder) from the 1-page version that is to be kept. For the latter, you could use the ExportAsFixedFormat method to create a PDF with just the first page. The alternative is to save the email version, then delete the 2nd page and use Save As to save the version that is to be kept. Either way, you'll probably want to delete the email version once it's been sent.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote