Skip i'r prif gynnwys

Sut i lawrlwytho / cadw atodiadau yn awtomatig o Outlook i ffolder benodol?

Er bod arbed pob atodiad o un e-bost yn Outlook yn syml gan ddefnyddio'r Ymlyniadau > Arbedwch yr holl Atodiadau opsiwn, gall rheoli atodiadau o e-byst lluosog, yn enwedig mewn symiau mawr, fod yn fwy heriol. Mae'r erthygl hon yn cyflwyno dau ateb effeithiol ar gyfer llwytho i lawr atodiadau yn awtomatig o negeseuon e-bost Outlook i ffolder penodol. Mae'r dulliau hyn yn arbennig o ddefnyddiol wrth ddelio â nifer o negeseuon e-bost ac atodiadau, gan symleiddio'r broses ac arbed amser.


Dadlwythwch atodiadau Outlook yn awtomatig i ffolder gyda VBA a rheol

Mae'r dull hwn yn cynnwys defnyddio sgript VBA, a fydd, o'i weithredu gyda rheol benodol, yn lawrlwytho ac yn arbed atodiadau yn awtomatig o negeseuon e-bost Outlook i ffolder dynodedig. Ewch ymlaen â'r camau canlynol:

  1. Pwyswch Alt + F11 i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.
  2. Cliciwch Mewnosod > Modiwlau, ac yna pastio isod sgript VBA i mewn i'r newydd agor Modiwlau ffenestr.

    VBA: Atodiadau Auto Save Outlook i mewn i ffolder benodol

    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

    Nodyn: Dewch o hyd i'r llinell sSaveFolder = "C: \ Defnyddwyr \ DT168 \ Dogfennau \ outlook-atodiadau \", a rhoi llwybr eich ffolder cyrchfan a ddymunir yn ei le.

  3. Arbedwch y sgript VBA a chau'r Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.
  4. Ewch i'r bost gweld, a chlicio Hafan > Rheolau > Rheoli Rheolau a Rhybuddion.
  5. Yn yr agoriad Rheolau a Rhybuddion blwch deialog, cliciwch y Rheol Newydd botwm ar y Rheolau E-bost tab.
  6. Yn y Dewin Rheolau blwch deialog sy'n ymddangos, dewiswch y Gwnewch gais ar y negeseuon a gefais opsiwn, a chliciwch ar y Digwyddiadau botwm.
  7. Yn y Dewin Rheolau (Pa amod(au) ydych chi am eu gwirio?) blwch deialog, cliciwch y Digwyddiadau botwm heb ddewis unrhyw opsiynau. Ac yna cliciwch ar y Ydy botwm yn y pop-up Microsoft Outlook blwch deialog.
  8. Yn y canlynol Dewin Rheolau (Beth ydych chi eisiau gwneud gyda'r neges?) blwch deialog, ewch ymlaen fel a ganlyn:
    1. Gwiriwch y rhedeg sgript opsiwn. Tip: Os na welwch yr opsiwn, os gwelwch yn dda ewch i'r tiwtorial hwn ar alluogi'r opsiwn "rhedeg sgript" yn Outlook.
    2. Cliciwch ar y testun glas danlinellu "sgript" i agor y Dewiswch Sgript blwch deialog. Yma, dewiswch y sgript a ychwanegwyd gennych 2 cam a chliciwch ar y OK botwm.
    3. Cliciwch ar y Digwyddiadau botwm i fynd ymlaen.
  9. Yn y Dewin Rheolau (A oes unrhyw eithriadau?) blwch deialog, cliciwch y Digwyddiadau botwm yn uniongyrchol.
  10. Yn yr olaf Dewin Rheolau blwch deialog, enwch y rheol yn y 1 cam blwch, gwiriwch yr opsiynau yn ôl yr angen yn y 2 cam adran, a chliciwch ar y Gorffen botwm.
  11. Caewch y Rheolau a Rhybuddion blwch deialog.

Canlyniad

Nawr, os dewisoch yr opsiwn "Rhedeg y rheol hon nawr ar negeseuon sydd eisoes yn y mewnflwch", bydd yr holl atodiadau o'ch cyfrif e-bost yn cael eu lawrlwytho a'u storio yn y ffolder cyrchfan penodedig. Yn ogystal, os gwnaethoch wirio'r opsiwn "Trowch y rheol hon ymlaen", bydd yr holl atodiadau o negeseuon e-bost sy'n dod i mewn yn cael eu llwytho i lawr yn awtomatig a'u cadw yn y ffolder dynodedig.


Dadlwythwch atodiadau Outlook yn awtomatig i ffolder gyda Kutools ar gyfer Outlook

Gyda Kutools ar gyfer Rhagolwg gosod ar eich cyfrifiadur, ei Datgysylltiad Auto swyddogaeth yn eich galluogi i lawrlwytho'r cyfan neu atodiadau Outlook penodol yn awtomatig yn seiliedig ar eich amodau gosodedig, gan eu cyfeirio'n gyfleus at ffolder a ddewiswyd. Yn ogystal, mae'r nodwedd hon yn cynnig yr hyblygrwydd i greu is-ffolderi. Mae'n darparu dau ddewis arall ar gyfer enwi'r is-ffolderi hyn: gallwch ddewis o un o'r fformatau, megis [ffolder neges] -[pwnc neges], neu dewiswch atodi llinyn testun wedi'i deilwra fel ôl-ddodiad i'r fformat o'ch dewis. Mae'r gallu hwn yn gwella trefniadaeth a hygyrchedd eich atodiadau yn fawr.

Kutools ar gyfer Rhagolwg: Supercharge Outlook gyda dros 100 o offer y mae'n rhaid eu cael. Prawf ei yrru AM DDIM am 60 diwrnod, dim tannau ynghlwm!   Read More ...   Lawrlwytho Nawr!

  1. Cliciwch Kutools > Datgysylltiad Auto i agor y deialog nodwedd.
  2. Yn y Atodiadau Auto Detach deialog, dewiswch y Datgysylltwch yr holl atodiadau a dderbyniwyd yn awtomatig opsiwn, a ffurfweddu fel a ganlyn:
    1. Cliciwch y botwm pori i nodi'r ffolder cyrchfan i arbed atodiadau datgysylltiedig yn awtomatig.
    2. (Dewisol) Gwiriwch y Datgysylltwch atodiadau yn yr arddull isod opsiwn os ydych yn dymuno creu is-ffolderi ar gyfer storio'r atodiadau.
      • Creu is-ffolderi mewn arddull islaw: Enwch yr is-ffolderi yn un o'r fformatau rhagddiffiniedig, fel [ffolder neges] -[pwnc neges].
      • Ail-enwi'r atodiadau sydd wedi'u cadw yn yr arddull islaw: Enwch yr is-ffolderi gan ddefnyddio un o'r fformatau rhagddiffiniedig ac ychwanegwch linyn testun arferol fel ôl-ddodiad.
    3. (Dewisol) Gwiriwch y Mae'r eicon ymlyniad yn dal i fod yn yr e-byst opsiwn i gadw dangosydd gweledol yn y negeseuon e-bost oedd ag atodiadau.
    4. Cliciwch Iawn.

Canlyniad

Gan ddechrau nawr, bydd yr holl atodiadau'n cael eu cadw'n awtomatig i'r ffolder penodedig ar ôl derbyn e-byst.

Tip: Os ydych am sefydlu datodiad awtomatig o atodiadau yn seiliedig ar reolau penodol, galluogwch y Datgysylltwch atodiadau yn ôl rheolau opsiwn yn y Atodiadau Auto Detach ymgom. Ar ôl hynny, cliciwch ar y Nghastell Newydd Emlyn botwm i ddiffinio eich amodau hidlo a gosodiadau arbed dymunol.

Nodiadau:

  • Eisiau cael mynediad i'r Datgysylltiad Auto nodwedd? Lawrlwythwch Kutools ar gyfer Rhagolwg nawr! Y tu hwnt i hyn, mae gan Kutools fyrdd o 100+ o nodweddion eraill ac mae'n cynnig treial 60 diwrnod am ddim. Peidiwch ag aros, rhowch gynnig arni heddiw!
  • Os ydych chi'n dymuno datgysylltu neu lawrlwytho atodiadau sy'n bodoli eisoes o sawl e-bost / pob un a dderbyniwyd yn Outlook, cymhwyso Kutools ar gyfer Outlook's Datgysylltwch Bawb (Atodiadau) or Cadw Popeth (Atodiadau) nodwedd.

Erthyglau cysylltiedig:


Offer Cynhyrchiant Swyddfa Gorau

Kutools ar gyfer Rhagolwg - Dros 100 o Nodweddion Pwerus i Werthu Eich Outlook

🤖 Cynorthwy-ydd Post AI: E-byst pro ar unwaith gyda hud AI - un clic i atebion athrylith, tôn berffaith, meistrolaeth amlieithog. Trawsnewid e-bostio yn ddiymdrech! ...

📧 E-bostio Automation: Allan o'r Swyddfa (Ar gael ar gyfer POP ac IMAP)  /  Amserlen Anfon E-byst  /  Auto CC/BCC gan Reolau Wrth Anfon E-bost  /  Awto Ymlaen (Rheolau Uwch)   /  Auto Ychwanegu Cyfarchiad   /  Rhannwch E-byst Aml-Dderbynnydd yn Negeseuon Unigol yn Awtomatig ...

📨 Rheoli E-bost: Dwyn i gof E-byst yn Hawdd  /  Rhwystro E-byst Sgam gan Bynciau ac Eraill  /  Dileu E-byst Dyblyg  /  Chwilio Manwl  /  Cydgrynhoi Ffolderi ...

📁 Ymlyniadau ProArbed Swp  /  Swp Datgysylltu  /  Cywasgu Swp  /  Auto Achub   /  Datgysylltiad Auto  /  Cywasgiad Auto ...

🌟 Rhyngwyneb Hud: 😊Mwy o Emojis Pretty a Cŵl   /  Rhowch hwb i'ch Cynhyrchiant Outlook gyda Golygfeydd Tabbed  /  Lleihau Outlook Yn lle Cau ...

???? Rhyfeddodau un clic: Ateb Pawb ag Ymlyniadau Dod i Mewn  /   E-byst Gwrth-Gwe-rwydo  /  🕘Dangos Parth Amser yr Anfonwr ...

👩🏼‍🤝‍👩🏻 Cysylltiadau a Chalendr: Swp Ychwanegu Cysylltiadau O E-byst Dethol  /  Rhannwch Grŵp Cyswllt i Grwpiau Unigol  /  Dileu Atgoffa Pen-blwydd ...

Dros Nodweddion 100 Aros Eich Archwiliad! Cliciwch Yma i Ddarganfod Mwy.

 

 

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