跳到主要內容

如何在Outlook中將多封電子郵件批量轉換為pdf文件?

在Outlook中,“另存為”功能只能將電子郵件另存為HTML,TXT,MHT,MSG和模板格式文件,如果要將電子郵件轉換為PDF文件,該怎麼辦? 在本文中,我將介紹一些解決此問題的技巧。

使用打印功能將一封電子郵件轉換為PDF文件

使用VBA將一封電子郵件轉換為PDF文件

使用另存為文件實用程序將批處理電子郵件轉換為單獨的PDF文件好主意3


使用打印功能將一封電子郵件轉換為PDF文件

在Outlook中,可以使用“打印”功能將一封電子郵件另存為PDF文件。

1.選擇要轉換為PDF的電子郵件,單擊 File > 列印, 選擇 Microsoft Print to PDF 來自 Printer 下拉列表,然後單擊 Print.
doc批處理將電子郵件轉換為pdf 1

2。 在裡面 Save Print Output As 對話框中,選擇一個路徑放置文件,並為其命名。
doc批處理將電子郵件轉換為pdf 2

3。 點擊 Save,然後點擊 Cancel 停止打印。
doc批處理將電子郵件轉換為pdf 3

現在,所選消息已轉換為PDF文件。

備註:此方法僅在Outlook 2016中有效。


使用VBA將一封電子郵件轉換為PDF文件

如果您使用的是Outlook 2007或2010,則可以應用VBA代碼將一封電子郵件轉換為PDF文件。

1.選擇一封電子郵件,然後按 Alt + F11 啟用 Microsoft Visual Basic for Applications 窗口。

2。 點擊 Insert > Module,然後將以下代碼粘貼到 Module 腳本。

VBA:將電子郵件轉換為pdf

Sub SaveAsPDFfile()
'UpdatebyExtendoffice
Dim MyOlNamespace As NameSpace
Dim MySelectedItem As MailItem
Dim Response As String
Dim FSO As Object, TmpFolder As Object
Dim tmpFileName As String
Dim wrdApp As Object
Dim wrdDoc As Object
Dim bStarted As Boolean
Dim dlgSaveAs As FileDialog
Dim fdfs As FileDialogFilters
Dim fdf As FileDialogFilter
Dim i As Integer
Dim WshShell As Object
Dim SpecialPath As String
Dim msgFileName As String
Dim strCurrentFile As String
Dim strName As String
Dim oRegEx As Object
Dim intPos As Long
Set MyOlNamespace = Application.GetNamespace("MAPI")
Set MySelectedItem = ActiveExplorer.Selection.Item(1)
Set FSO = CreateObject("Scripting.FileSystemObject")
tmpFileName = FSO.GetSpecialFolder(2)
strName = "email_temp.mht"
tmpFileName = tmpFileName & "\" & strName
MySelectedItem.SaveAs tmpFileName, 10
On Error Resume Next
Set wrdApp = GetObject(, "Word.Application")
If Err Then
Set wrdApp = CreateObject("Word.Application")
bStarted = True
End If
On Error GoTo 0
Set wrdDoc = wrdApp.Documents.Open(FileName:=tmpFileName, Visible:=False, Format:=7)
Set dlgSaveAs = wrdApp.FileDialog(msoFileDialogSaveAs)
Set fdfs = dlgSaveAs.Filters
i = 0
For Each fdf In fdfs
i = i + 1
If InStr(1, fdf.Extensions, "pdf", vbTextCompare) > 0 Then
Exit For
End If
Next fdf
dlgSaveAs.FilterIndex = i
Set WshShell = CreateObject("WScript.Shell")
SpecialPath = WshShell.SpecialFolders(16)
msgFileName = MySelectedItem.Subject
Set oRegEx = CreateObject("vbscript.regexp")
oRegEx.Global = True
oRegEx.Pattern = "[\/:*?""<>|]"
msgFileName = Trim(oRegEx.Replace(msgFileName, ""))
dlgSaveAs.InitialFileName = SpecialPath & "\" & msgFileName
If dlgSaveAs.Show = -1 Then
strCurrentFile = dlgSaveAs.SelectedItems(1)
If Right(strCurrentFile, 4) <> ".pdf" Then
Response = MsgBox("Sorry, only saving in the pdf-format is supported." & _
vbNewLine & vbNewLine & "Save as pdf instead?", vbInformation + vbOKCancel)
If Response = vbCancel Then
wrdDoc.Close 0
If bStarted Then wrdApp.Quit
Exit Sub
ElseIf Response = vbOK Then
intPos = InStrRev(strCurrentFile, ".")
If intPos > 0 Then
strCurrentFile = Left(strCurrentFile, intPos - 1)
End If
strCurrentFile = strCurrentFile & ".pdf"
End If
End If
wrdApp.ActiveDocument.ExportAsFixedFormat OutputFileName:= _
strCurrentFile, _
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
End If
Set dlgSaveAs = Nothing
wrdDoc.Close
If bStarted Then wrdApp.Quit
Set MyOlNamespace = Nothing
Set MySelectedItem = Nothing
Set wrdDoc = Nothing
Set wrdApp = Nothing
Set oRegEx = Nothing
End Sub

doc批處理將電子郵件轉換為pdf 4

3。 按 F5 鍵啟用檔案儲存對話框,選擇一個資料夾來放置檔案並為其命名。
doc批處理將電子郵件轉換為pdf 5

4。 點擊 Save.

尖端:如果程式碼無法執行,您可以嘗試進入信任中心,勾選巨集設定部分的啟用所有巨集選項。
doc批處理將電子郵件轉換為pdf 6


使用另存為文件實用程序將批處理電子郵件轉換為單獨的PDF文件

透過上述方法,您一次只能將一封郵件儲存為PDF文件,如果您想將多封電子郵件批次轉換為單獨的PDF文件,您可以嘗試 Kutools for Outlook批量保存 效用。

Kutools for Outlook, 包括  Microsoft Outlook 2016、2013、2010和Office 365的強大功能和工具。

免費安裝 Kutools for Outlook,然後執行以下步驟:

1. 選擇您要轉換的電子郵件,然後按一下 Kutools > Bulk Save.
doc批處理將電子郵件轉換為pdf 7

2。 在裡面 Save message as other files 對話方塊中,選擇檔案所在的路徑,然後檢查 PDF 格式選項,您可以在右側查看有關儲存內容的選項。
doc批處理將電子郵件轉換為pdf 8

3。 點擊 Ok.

現在電子郵件已轉換為 PDF 檔案。
doc批處理將電子郵件轉換為pdf 10


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

📁 附件專業版批量保存  /  批量分離  /  批量壓縮  /  自動保存   /  自動分離  /  自動壓縮 ...

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

閱讀更多       免費下載      購買
 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations