Loncat ke daftar isi utama

Bagaimana cara mengunduh / menyimpan lampiran secara otomatis dari Outlook ke folder tertentu?

Meskipun menyimpan semua lampiran dari satu email di Outlook sangatlah mudah menggunakan lampiran > Simpan Semua Lampiran pilihannya, mengelola lampiran dari beberapa email, terutama dalam jumlah besar, bisa jadi lebih menantang. Artikel ini memperkenalkan dua solusi efektif untuk mengunduh lampiran secara otomatis dari email Outlook ke folder tertentu. Metode ini sangat berguna ketika menangani banyak email dan lampiran, sehingga menyederhanakan proses dan menghemat waktu.


Unduh lampiran Outlook secara otomatis ke folder dengan VBA dan aturan

Pendekatan ini melibatkan penggunaan skrip VBA, yang bila dijalankan dengan aturan tertentu, secara otomatis akan mengunduh dan menyimpan lampiran dari email Outlook ke folder yang ditentukan. Silakan lanjutkan dengan langkah-langkah berikut:

  1. Tekan Alt + F11 untuk membuka Microsoft Visual Basic untuk Aplikasi jendela.
  2. Klik Menyisipkan > Modul, lalu pastekan script VBA di bawah ini ke yang baru dibuka Modul jendela.

    VBA: Simpan Otomatis Lampiran Outlook ke folder tertentu

    Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
    Dim oAttachment As Outlook.Attachment
    Dim sSaveFolder As String
    sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\"
    For Each oAttachment In MItem.Attachments
    oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
    Next
    End Sub

    Catatan: Silakan temukan jalurnya sSaveFolder = "C: \ Users \ DT168 \ Documents \ outlook-attachments \", dan ganti dengan jalur folder tujuan yang Anda inginkan.

  3. Simpan skrip VBA dan tutup Microsoft Visual Basic untuk Aplikasi jendela.
  4. Pergi ke surat lihat, dan klik Beranda > Peraturan > Kelola Aturan & Peringatan.
  5. Di pembukaan Aturan dan Peringatan kotak dialog, silakan klik Aturan baru tombol pada Aturan Email Tab.
  6. Dalam majalah Penyihir Aturan kotak dialog yang muncul, silakan pilih Terapkan aturan pada pesan yang saya terima pilihan, dan klik Selanjutnya .
  7. Dalam majalah Rules Wizard (Kondisi manakah yang ingin Anda periksa?) kotak dialog, klik Selanjutnya tombol tanpa memilih opsi apa pun. Dan kemudian klik Yes tombol di pop-up Microsoft Outlook kotak dialog.
  8. Dalam berikut Rules Wizard (Apa yang ingin Anda lakukan dengan pesan tersebut?) kotak dialog, lanjutkan sebagai berikut:
    1. Periksalah menjalankan skrip . olymp trade indonesiaTip: Jika Anda tidak melihat opsi tersebut, silakan buka tutorial ini tentang mengaktifkan opsi "jalankan skrip" di Outlook.
    2. Klik teks "skrip" yang digarisbawahi biru untuk membuka Pilih Script kotak dialog. Di sini, pilih skrip yang Anda tambahkan Langkah 2 Dan klik OK .
    3. klik Selanjutnya untuk melanjutkan.
  9. Dalam majalah Rules Wizard (Apakah ada pengecualian?) kotak dialog, silakan klik Selanjutnya tombol secara langsung.
  10. Terakhir Penyihir Aturan kotak dialog, harap beri nama aturan di Langkah 1 kotak, centang opsi yang Anda butuhkan di Langkah 2 bagian, dan klik Finish .
  11. Tutup Aturan dan Peringatan kotak dialog.

Hasil

Sekarang, jika Anda memilih opsi "Jalankan aturan ini sekarang pada pesan yang sudah ada di kotak masuk", semua lampiran dari akun email Anda akan diunduh dan disimpan di folder tujuan yang ditentukan. Selain itu, jika Anda mencentang opsi "Aktifkan aturan ini", semua lampiran dari email masuk akan otomatis diunduh dan disimpan ke folder yang ditentukan.


Unduh lampiran Outlook secara otomatis ke folder dengan Kutools for Outlook

Dengan Kutools untuk Outlook diinstal di komputer Anda, itu Lepaskan Otomatis fungsi memberdayakan Anda untuk secara otomatis mengunduh semua atau lampiran Outlook tertentu berdasarkan kondisi yang Anda tetapkan, dengan mudah mengarahkannya ke folder yang dipilih. Selain itu, fitur ini menawarkan fleksibilitas untuk membuat subfolder. Ini memberikan dua alternatif untuk memberi nama subfolder ini: Anda dapat memilih salah satu format, seperti [folder pesan]-[subjek pesan], atau memilih untuk menambahkan string teks khusus sebagai sufiks ke format pilihan Anda. Kemampuan ini sangat meningkatkan pengorganisasian dan aksesibilitas lampiran Anda.

Kutools untuk Outlook: Tingkatkan Outlook dengan lebih dari 100 alat yang harus dimiliki. Uji coba GRATIS selama 60 hari, tanpa pamrih!   Read More ...   Download Sekarang!

  1. Klik Kutools > Lepaskan Otomatis untuk membuka dialog fitur.
  2. Dalam majalah Lampiran Lepas Otomatis dialog, pilih Lepaskan otomatis semua lampiran yang diterima pilihan, dan konfigurasikan sebagai berikut:
    1. Klik tombol jelajah untuk menentukan folder tujuan menyimpan lampiran yang terlepas secara otomatis.
    2. (Opsional) Centang Lepaskan lampiran dengan gaya di bawah ini pilihan jika Anda ingin membuat subfolder untuk menyimpan lampiran.
      • Buat subfolder dengan gaya di bawah ini: Beri nama subfolder dalam salah satu format yang telah ditentukan, misalnya [folder pesan]-[subjek pesan].
      • Ubah nama lampiran yang disimpan dengan gaya di bawah ini: Beri nama subfolder menggunakan salah satu format yang telah ditentukan sebelumnya dan tambahkan string teks khusus sebagai akhiran.
    3. (Opsional) Centang Ikon lampiran masih tetap ada di email opsi untuk menyimpan indikator visual di email yang memiliki lampiran.
    4. Klik Ok.

Hasil

Mulai sekarang, semua lampiran akan secara otomatis disimpan ke folder yang ditentukan setelah menerima email.

olymp trade indonesiaTip: Jika Anda ingin mengatur pelepasan lampiran otomatis berdasarkan aturan tertentu, aktifkan Lepaskan lampiran secara otomatis berdasarkan aturan pilihan dalam Lampiran Lepas Otomatis dialog. Setelah itu, klik New tombol untuk menentukan kondisi filter dan pengaturan penyimpanan yang diinginkan.

Catatan:

  • Ingin mengakses Lepaskan Otomatis fitur? Unduh Kutools untuk Outlook Sekarang! Selain itu, Kutools menawarkan lebih dari 100 fitur lainnya dan menawarkan uji coba gratis selama 60 hari. Jangan menunggu, cobalah hari ini!
  • Jika Anda ingin melepaskan atau mengunduh lampiran yang ada dari beberapa/semua email yang diterima di Outlook, terapkan Kutools for Outlook's Lepaskan Semua (Lampiran) or Simpan Semua (Lampiran) fitur.

Artikel terkait:


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 (115)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Thank you for this information
This comment was minimized by the moderator on the site
May i ask some question?

I usually received mail to many people and many kinds of files.
So i should distinguish each file.
But now, It can`t.

So Did you have any idea for this?
(like chacnged file name or and so on...)

Thank you for your help

BR
Hansu
This comment was minimized by the moderator on the site
Thank you for your great code
This comment was minimized by the moderator on the site
Hi,
I create Module in Microsoft VBA & save it
However when go to create Rules in Outlook, I can't see the select box of "Run a script"
What is the reason & how to fix it?
Thank you
This comment was minimized by the moderator on the site
Hi there,

In some versions of Outlook, especially in more recent updates, the "Run a Script" option might be disabled by default due to security concerns. To enable the "Run a Script" option in Outlook, you usually need to modify the registry settings. Here's a general guide on how to do it:

1. Close Outlook: Make sure Outlook is not running.
2. Open Registry Editor: Press Win + R, type regedit, and hit Enter.
3. Navigate to the Outlook Security Settings: Depending on your version of Outlook, you'll need to navigate to a specific path in the Registry Editor. For example, for Outlook 2016, 2019, and Microsoft 365, you might navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security.
4. Modify/Add the Registry Value:
4.1 Right-click in the right pane and choose New > DWORD (32-bit) Value.
4.2 Name the new value as EnableUnsafeClientMailRules.
4.3 Set its value to 1.
5. Close Registry Editor and restart your computer.
6. Open Outlook and check if the "Run a Script" option is available.
This comment was minimized by the moderator on the site
Ale kupa, oszuści. Maile zaczynają znikać. Nie mam moich wiadomości.
This comment was minimized by the moderator on the site
Hi, code works great however I am saving excel files and was wondering how I can modify the saved name. I recieve files like this "exa 2022-08.xlsx" how can I save the excel file as just "2022-08"?

this is my current code and my file saves however as just a file type not excel.

Public Sub PortlandDaily(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "T:\_Portland\Engineering Data\Daily Production Data\Test\"
For Each oAttachment In MItem.Attachments

Dim SplitName() As String
SplitName = Split(oAttachment.DisplayName, ".")

Dim RightName As String
RightName = Right(SplitName(0), 7)

Dim SaveName As String

SaveName = sSaveFolder & RightName

oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName

Next
End Sub
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
Hi there,

Please try the code below:
Public Sub PortlandDaily(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "T:\_Portland\Engineering Data\Daily Production Data\Test\"
For Each oAttachment In MItem.Attachments
  Dim SplitName() As String
  SplitName = Split(oAttachment.DisplayName, ".")
  Dim RightName As String
  RightName = Right(SplitName(0), 7) 'You can also declare the file name here, e.g., RightName = "2022-08"
  Dim SaveName As String
  SaveName = sSaveFolder & RightName & "." & SplitName(1)
  oAttachment.SaveAsFile SaveName
Next
End Sub


Amanda
This comment was minimized by the moderator on the site
Hi. is it possible to give the attachment file an entirely new name, using information form the mail (for example the date of delivery).
This comment was minimized by the moderator on the site
Hi,
How can I create a VBA to save attachment (Excel file) in my location drive when email received in my outlook folder and using the file name based on cell value...Many thanks

Regards,
Anthony On
This comment was minimized by the moderator on the site
Bonjour, j'ai réussi à rajouter "exécuter un script" dans les règles et faire fonctionner le script dans outlook. Les pièces jointes d'un mail bien précis s'enregistrent parfaitement dans le dossier demandé. Sauf que j'aimerais enregistrer uniquement les fichiers .txt, et non les .pdf qui s'incrémentent également. Aussi j'ai une autre requête s'il vous plaît, le script fonctionne très bien pour définir un dossier de destination, mais je souhaite définir d'autres règles qui me permettraient d'enregistrer les pièces jointes d'autres mails vers un autre dossier de destination. J'ai essayé de faire un 2e module VBA, cela ne fonctionne pas. J'ai généré un deuxième projet VBA mais Outlook n'en gère qu'un seul. Dans ce cas, comment remédier s'il vous plait ? Merci pour ce tuto très clair pour moi qui suis débutante.
This comment was minimized by the moderator on the site
Hi pearl,
Could you please send the code you generated so that we can fix it?
Amanda
This comment was minimized by the moderator on the site
Hi Can we  download the attachment contains specific letters using VBA code
This comment was minimized by the moderator on the site
Hi DAS,
When you said “the attachment contains specific letters”, did you mean you want to download the attachments from specific letters?
Amanda
This comment was minimized by the moderator on the site
Hi,
I executed the VBA + Rule option and it seemed to work perfectly. However, it recently stopped working with no errors. The rule is set to read the subject line, move to a certain folder if there is a certain subject, and then run the script. I know the trigger is working in the rule because the first action (move to folder) is working as it should.
Any idea why the rule trigger would work, but the documents are no longer being saved?
Things I have tried/checked:-The file path is correct-I added delays in various spots in the vba using application.wait-outlook has been shutdown and re-opened, and so has my laptop
(disclosure: I am a bit of a VBA newbie, but have beginner level coding knowledge)
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