Microsoft Office Forums VBA to create a button to attach the active word doc to an email as a PDF without using Outlook

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2017, 06:51 AM
TAKMalcolm TAKMalcolm is offline VBA to create a button to attach the active word doc to an email as a PDF without using Outlook Windows 7 32bit VBA to create a button to attach the active word doc to an email as a PDF without using Outlook Office 2010 32bit
Novice
VBA to create a button to attach the active word doc to an email as a PDF without using Outlook
 
Join Date: Sep 2017
Posts: 1
TAKMalcolm is on a distinguished road
Default VBA to create a button to attach the active word doc to an email as a PDF without using Outlook

I sincerely apologize if this exact question has been asked before - I've been searching for awhile and haven't had much luck.

Very new to VBA - trying to use a macro to create a "submit" button that will convert the active document to a PDF and attach it to an email in IBM Notes. Most of the resources I've found provide code to perform this operation using Microsoft Outlook as the email client, but I haven't been able to find out much otherwise.

I've had success adding the document to an email in IBM Notes using this code:

Private Sub CommandButton1_Click()
Options.SendMailAttach = True
ActiveDocument.SendMail
End Sub

However, it would be ideal if I could have the document attached as PDF. I was also able to find coding to save the active document as a PDF:

Sub CommandButton1_Click()

ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\example\DocName", _


ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentWithMarkup, IncludeDocProps:=False, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False

End Sub

I'm able to successfully create the PDF document using that code, saving it to the location listed "C:\Users\example\DocName" - I don't really need to keep the document saved as a PDF if I can get it to attach to an email in IBM Notes.

Any help is greatly appreciated!
Thanks!!
Reply With Quote
  #2  
Old 09-21-2017, 01:52 AM
gmayor's Avatar
gmayor gmayor is offline VBA to create a button to attach the active word doc to an email as a PDF without using Outlook Windows 10 VBA to create a button to attach the active word doc to an email as a PDF without using Outlook Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,939
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

http://www.cpearson.com/Excel/EMail.aspx might point a way.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
macro, vba, word 2010

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to create a button to attach the active word doc to an email as a PDF without using Outlook How do I attach a ribbon button to a particular template in Word 2010? HelenT Word VBA 1 10-07-2015 03:32 AM
File Not Found error when trying to attach Word document to email Kimber Word 0 03-06-2015 06:47 PM
VBA to create a button to attach the active word doc to an email as a PDF without using Outlook Having Touble Finding Word File When Trying to Attach to Email freetibet213 Word 3 12-28-2011 05:26 AM
Drag Button which refers to the active Word document to Explorer DRob Word 0 10-03-2010 06:40 AM
Help on option button active X aligahk06 Excel 0 11-03-2009 11:39 PM


All times are GMT -7. The time now is 06:15 PM.


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