Loncat ke daftar isi utama

Bagaimana cara menyimpan email sebagai file pdf di Outlook?

Jika Anda bekerja dengan Microsoft Outlook 2010 dan 2007, Anda akan menemukan bahwa tidak ada bawaan di Outlook untuk mengubah email ke format pdf. Anda perlu mengonversi email ke file pdf dengan beberapa add-in terkait atau dengan kode VBA. Dengan artikel berikut, Anda akan dengan mudah menyimpan email sebagai file pdf di Outlook.

Simpan email sebagai file pdf di Outlook dengan kode VBA

Simpan banyak email secara massal sebagai file pdf atau format file lainnya dengan Bulk Saveide bagus3


Simpan email sebagai file pdf di Outlook dengan kode VBA

1. Pertama-tama Anda harus memilih email yang ingin Anda simpan sebagai PDF.

2. tekan Alt + F11 untuk meluncurkan Microsoft Visual Basic untuk Aplikasi jendela.

3. klik Menyisipkan > Modul, lalu salin dan tempel kode VBA berikut ke jendela Modul.

Kode VBA untuk menyimpan email sebagai file PDF:

Sub SaveAsPDFfile()
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

Note: Kode VBA ini telah berhasil diuji di Outlook 2007 dan 2010

4. klik untuk menjalankan kode.

5. Akan ada Simpan File dialog muncul saat kode sedang berjalan. Pilih jalur untuk menyimpan file, beri nama, dan terakhir klik Save .

6. Setelah kode selesai dijalankan, email telah berhasil dikonversi ke file pdf.


Simpan banyak email secara massal sebagai file pdf atau format file lainnya dengan Bulk Save

Dengan Kutools for Outlook diinstal, Anda dapat menggunakan file Bulk Save utilitas untuk dengan cepat menyimpan atau mengekspor email yang dipilih ke file PDF / file Excel / file CSV atau format file lainnya.

Kutools for Outlook, termasuk fitur dan alat canggih untuk Microsoft Outlook 2019, 2016, 2013, 2010, dan Office 365.

1. Dalam sebuah folder email, pilih pesan yang ingin Anda simpan sebagai PDF, klik Kutools > Bulk Save.
doc kutools penyimpanan massal 1

2. Dalam Bulk Save dialog, pilih jalur untuk menempatkan file baru, periksa PDF format, dan Anda dapat menentukan Save content seperti yang Anda butuhkan
doc simpan email sebagai pdf 4

3. klik Ok. Kemudian email yang dipilih telah disimpan sebagai file PDF satu per satu.
doc simpan email sebagai pdf 5


Alat Produktivitas Kantor Terbaik

Kutools untuk Outlook - Lebih dari 100 Fitur Canggih untuk Meningkatkan Outlook Anda

🤖 Asisten Surat AI: Email profesional instan dengan keajaiban AI--satu klik untuk mendapatkan balasan jenius, nada sempurna, penguasaan multibahasa. Ubah email dengan mudah! ...

📧 Email Otomatis: Di Luar Kantor (Tersedia untuk POP dan IMAP)  /  Jadwal Kirim Email  /  Auto CC/BCC Sesuai Aturan Saat Mengirim Email  /  Penerusan Otomatis (Aturan Lanjutan)   /  Tambah Salam Otomatis   /  Secara Otomatis Membagi Email Multi-Penerima menjadi Pesan Individual ...

📨 email Management: Mengingat Email dengan Mudah  /  Blokir Email Penipuan berdasarkan Subjek dan Lainnya  /  Hapus Email Duplikat  /  Pencarian  /  Konsolidasi Folder ...

📁 Lampiran ProPenyimpanan Batch  /  Pelepasan Batch  /  Kompres Batch  /  Penyimpanan otomatis   /  Lepaskan Otomatis  /  Kompres Otomatis ...

🌟 Antarmuka Ajaib: 😊Lebih Banyak Emoji Cantik dan Keren   /  Tingkatkan Produktivitas Outlook Anda dengan Tampilan Tab  /  Minimalkan Outlook Daripada Menutup ...

👍 Keajaiban sekali klik: Balas Semua dengan Lampiran Masuk  /   Email Anti-Phishing  /  🕘Tampilkan Zona Waktu Pengirim ...

👩🏼‍🤝‍👩🏻 Kontak & Kalender: Batch Tambahkan Kontak Dari Email yang Dipilih  /  Bagi Grup Kontak menjadi Grup Individual  /  Hapus Pengingat Ulang Tahun ...

Lebih 100 Fitur Tunggu Eksplorasi Anda! Klik Di Sini untuk Menemukan Lebih Banyak.

 

 

Comments (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
or (but for this you need to open the mail) you could use this:
ActiveInspector.WordEditor.ExportAsFixedFormat "c:\temp\test.pdf",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

This comment was minimized by the moderator on the site
Hi !!
I have follow all the instructions but it doesn't work, " Compile error : Syntax error"
Can you help me ? Please
Amaury
This comment was minimized by the moderator on the site
This macro is really great and easy to use as well,thank you so much for sharing this.
Just wanted to check is it possible to create same kind of macro for PDF attachment as well,because the above macro works only for excel and word format.

Can any one one help me on this.
This comment was minimized by the moderator on the site
I am wondering how I could change the folder the pdf goes to and change the filename(since all the emails I am copying are called the same thing
This comment was minimized by the moderator on the site
Been wondering how to do this for years, very easy, thank you
This comment was minimized by the moderator on the site
Hi All, PDF is saving in default size and I can't see all text, tables, etc. from email. How can I fix that? Is it any way to save email as PDF file in responsive size?
This comment was minimized by the moderator on the site
The VBA code works perfectly! Now, is there any way to adjust this in order to default "save as" to be .msg in Outlook 2007?
This comment was minimized by the moderator on the site
I have been able to use this. But now when I run it is just saving a copy of this page. I get a PDF of the instructions rather than the email I was trying to convert. Any suggestions?
This comment was minimized by the moderator on the site
Super, worked like a charm. Thank you very much
This comment was minimized by the moderator on the site
Many thanks, friend. This was a great help.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations