![]() |
|
#1
|
|||
|
|||
|
Hi all
Does Outlook 2016 have a way to add PDF to the printer options? I'd like to save emails as a PDF file but cant seem to do so. I have Adobe Acrobat but not sure how to add it as a print option. Any suggestions would be much appreciated. Thanks |
|
#2
|
|||
|
|||
|
If you have Adobe Acrobat (one of the paid for Pro versions- not Adobe Acrobat Reader), the Adobe Print option should be added to the print list by default.
If it isn’t, perhaps a Repair Installation might add it for you. Alternatively, you can try add it manually. https://forums.adobe.com/thread/1076693 You could add a PDF Print Driver to give you what you want (add *PDF Print) to the print list. An example being CutePDF - http://www.cutepdf.com/Products/CutePDF/writer.asp If you have the Office 2016 package, it should come with OneNote and using that option from within Outlook 2016 allows you to send an message to OneNote and Export the message in PDF format to a location of your choice. I have the OneNote icon in the Ribbon by default in the Move section: ![]() When you click the OneNote tab, it will open a dialog box and ask you where you want to save the message – something like this: ![]() I have select Unfiled Notes (Personal) and checked ‘Always send e-mail notes to the selected location' (this can be changed in the options later if it’s not what you want. ‘ > OK. OneNote will open, with the email message on view. Click File > Export > Export Current (Page) > Export Format (PDF) > Export. ![]() You should get box opening for a save location. PDF is already used as File Type. Just click Save and you’ve got your PDF message. Shut the OneNote window. Last edited by Moonshine; 05-08-2018 at 04:35 AM. |
|
#3
|
||||
|
||||
|
You can do it with the Office PDF function by employiing an Outlook Macro and a couple of useful functions to ensure duplicate filenames are not overwritten:
Code:
Option Explicit
Private wdApp As Object
Private wdDoc As Object
Private bStarted As Boolean
Const strPath As String = "C:\Path\Email Messages\"
Sub SaveSelectedMessagesAsPDF()
'Select the messages to process and run this macro
Dim olMsg As MailItem
'Create the folder to store the messages if not present
If CreateFolders(strPath) = False Then GoTo lbl_Exit
'Open or Create a Word object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err Then
Set wdApp = CreateObject("Word.Application")
bStarted = True
End If
On Error GoTo 0
For Each olMsg In Application.ActiveExplorer.Selection
SaveAsPDFfile olMsg
Next olMsg
lbl_Exit:
If bStarted Then wdApp.Quit
Set olMsg = Nothing
Set wdApp = Nothing
Exit Sub
End Sub
Sub SaveAsPDFfile(olItem As MailItem)
'Graham Mayor - http://www.gmayor.com - Last updated - 08 May 2018
Dim olNS As NameSpace
Dim fso As Object, TmpFolder As Object
Dim tmpPath As String
Dim strFileName As String
Dim strName As String
Dim oRegex As Object
Set olNS = Application.GetNamespace("MAPI")
Set fso = CreateObject("Scripting.FileSystemObject")
tmpPath = fso.GetSpecialFolder(2)
strName = "email_temp.mht"
tmpPath = tmpPath & "\" & strName
olItem.SaveAs tmpPath, 10
Set wdDoc = wdApp.Documents.Open(fileName:=tmpPath, _
AddToRecentFiles:=False, _
Visible:=False, _
Format:=7)
strFileName = olItem.Subject
Set oRegex = CreateObject("vbscript.regexp")
oRegex.Global = True
oRegex.Pattern = "[\/:*?""<>|]"
strFileName = Trim(oRegex.Replace(strFileName, "")) & ".pdf"
strFileName = FileNameUnique(strPath, strFileName, "pdf")
strFileName = strPath & strFileName
wdDoc.ExportAsFixedFormat OutputFileName:= _
strFileName, _
ExportFormat:=17, _
OpenAfterExport:=False, _
OptimizeFor:=0, _
Range:=0, _
From:=0, _
To:=0, _
Item:=0, _
IncludeDocProps:=True, _
KeepIRM:=True, _
CreateBookmarks:=0, _
DocStructureTags:=True, _
BitmapMissingFonts:=True, _
UseISO19005_1:=False
wdDoc.Close 0
If fso.FileExists(tmpPath) = True Then Kill tmpPath
lbl_Exit:
Set olNS = Nothing
Set olItem = Nothing
Set wdDoc = Nothing
Set oRegex = Nothing
Exit Sub
End Sub
Private Function CreateFolders(strPath As String) As Boolean
Dim strTempPath As String
Dim lngPath As Long
Dim vPath As Variant
vPath = Split(strPath, "\")
strPath = vPath(0) & "\"
For lngPath = 1 To UBound(vPath)
strPath = strPath & vPath(lngPath) & "\"
On Error GoTo err_Handler
If Not FolderExists(strPath) Then MkDir strPath
Next lngPath
CreateFolders = True
lbl_Exit:
Exit Function
err_Handler:
MsgBox "The path " & strPath & " is invalid!"
CreateFolders = False
Resume lbl_Exit
End Function
Private Function FileNameUnique(strPath As String, _
strFileName As String, _
strExtension As String) As String
Dim lngF As Long
Dim lngName As Long
lngF = 1
lngName = Len(strFileName) - (Len(strExtension) + 1)
strFileName = Left(strFileName, lngName)
Do While FileExists(strPath & strFileName & Chr(46) & strExtension) = True
strFileName = Left(strFileName, lngName) & "(" & lngF & ")"
lngF = lngF + 1
Loop
FileNameUnique = strFileName & Chr(46) & strExtension
lbl_Exit:
Exit Function
End Function
Private Function FolderExists(fldr) As Boolean
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(fldr)) Then
FolderExists = True
Else
FolderExists = False
End If
lbl_Exit:
Set fso = Nothing
Exit Function
End Function
Private Function FileExists(filespec) As Boolean
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filespec) Then
FileExists = True
Else
FileExists = False
End If
lbl_Exit:
Set fso = Nothing
Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#4
|
|||
|
|||
|
Thanks Moonshine. I errored in saying that I have Adobe Acrobat. I have Adobe Reader 9 (which I thought was the same thing). I do howeber have both Office and Outlook 2016, but I do not have the "OneNote icon in the Ribbon by default in the Move section". When I click PRINT and go to PRINT OPTIONS I can change the printer to SEND TO OneNOTE 2016. I then click PRINT TO FILE then PRINT where I can save to my desired destination. It saves as a .prn Word document and will not allow me to open it because I get the error message:
We're sorry. We cant open *.prn because we found a problem with its content I instead downloaded the CutePDF program and I am good to go. Thank you so very much. |
|
#5
|
|||
|
|||
|
Thanks GMayor. Unfortunately I am on a company computer and do not have administrative rights to make those kind of changes/updates.
|
|
#6
|
|||
|
|||
|
If you are trying the OneNote option and you have never opened OneNoted previously, you will probably be warned, when clicking the Outlook, OneNote tab, that it needs setting up first.
|
|
#7
|
|||
|
|||
|
Moonshine..I edited my previous reply. I am good to go after I downloaded CutePDF. Thanks for your help!!!!
|
|
#8
|
|||
|
|||
|
Pleased to help out.
I'm not sure why you opted to Print to File though. At my end, changing the Printer to 'Sendto OneNote 16', then clicking the Print tab (not via the Print Options tab), opens OneNote (In TaskBar) to then Export as above. Still, as long as you have a reasonable solution. Cheers. Re the missing OneNote Tab in Outlook. You'll need to check the Add-ins via the Options and make sure that it is included. ![]() You'll still need to run OneNote for the first time to set it up in order to use it though. |
|
#9
|
|||
|
|||
|
Moonshine
I am using Windows 7 with Office 2016, I am guessing thats why I dont have that add-in. I checked the available Add-Ins and OneNote is not there. I am guessing its not supported in Windows 7 maybe??? But either way I was able to accomplish my desired goal. Thanks again.... |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Convert MS-Word document to PDF and email
|
naeemakhtar | Word VBA | 3 | 04-03-2018 07:46 PM |
Rename docm to value from checkbox, convert to .pdf, email, delete
|
Lortiz70 | Word VBA | 1 | 01-19-2017 02:48 AM |
Macro to convert table to convert table into iCalendar file?
|
Weboh | Word VBA | 5 | 12-10-2016 03:07 PM |
| Hide Email Address of Previous Email when Replying or Forwarding | bondingfortoday | Outlook | 0 | 03-05-2016 04:29 PM |
| Convert mail merge to PDF then email | TeriJean | Mail Merge | 0 | 10-04-2011 03:52 PM |