Skip i'r prif gynnwys

Sut i arbed nifer o negeseuon e-bost a ddewiswyd fel ffeiliau MSG mewn swmp yn Outlook?

Mae'n hawdd arbed e-bost fel ffeil MSG yn Outlook. Sut allwch chi arbed nifer o negeseuon e-bost a ddewiswyd fel ffeiliau MSG unigol mewn swmp yn Outlook? Bydd yr erthygl hon yn dangos dull i chi ei gyflawni.

Cadwch sawl e-bost a ddewiswyd fel ffeiliau MSG gyda chod VBA


Cadwch sawl e-bost a ddewiswyd fel ffeiliau MSG gyda chod VBA

Gall y cod VBA canlynol eich helpu i arbed nifer o negeseuon e-bost a ddewiswyd fel ffeiliau MSG unigol mewn swmp yn Outlook. Gwnewch fel a ganlyn.

1. Dewiswch yr e-byst rydych chi am eu cadw fel ffeiliau MSG. Yna pwyswch y bysellau Alt + F11 ar yr un pryd i agor ffenestr Microsoft Visual Basic for Applications.

2. Yn ffenestr Microsoft Visual Basic for Applications, cliciwch Mewnosod> Modiwl, ac yna copïwch isod god VBA i mewn i ffenestr y Modiwl.

Cod VBA: Cadwch sawl e-bost dethol fel ffeiliau MSG unigol yn Outlook

Public Sub SaveMessageAsMsg()
'Update by Extendoffice 2018/3/5
Dim xMail As Outlook.MailItem
Dim xObjItem As Object
Dim xPath As String
Dim xDtDate As Date
Dim xName, xFileName As String
On Error Resume Next
Set xShell = CreateObject("Shell.Application")
Set xFolder = xShell.BrowseForFolder(0, "Select a folder:", 0, strStartingFolder)
If Not TypeName(xFolder) = "Nothing" Then
    Set xFolderItem = xFolder.self
    xFileName = xFolderItem.Path & "\"
Else
    xFileName = ""
    Exit Sub
End If
For Each xObjItem In Outlook.ActiveExplorer.Selection
    If xObjItem.Class = olMail Then
        Set xMail = xObjItem
        xName = xMail.Subject
        xDtDate = xMail.ReceivedTime
        xName = Format(xDtDate, "yyyymmdd", vbUseSystemDayOfWeek, _
          vbUseSystem) & Format(xDtDate, "-hhnnss", _
          vbUseSystemDayOfWeek, vbUseSystem) & "-" & xName & ".msg"
        xPath = xFileName + xName
        xMail.SaveAs xPath, olMSG
    End If
Next
End Sub

3. Pwyswch y fysell F5 i redeg y cod.

4. Yn y blwch deialog Pori Am Ffolder, nodwch ffolder i gadw'r ffeiliau MSG ac yna cliciwch ar y botwm OK. Gweler y screenshot:

Nawr mae'r holl negeseuon e-bost a ddewiswyd yn cael eu cadw fel ffeiliau MSG unigol fel y dangosir isod.


Yn hawdd arbed e-byst dethol fel ffeiliau fformat gwahanol yn Outlook:

Efo'r Arbed Swmp cyfleustodau Kutools ar gyfer Rhagolwg, gallwch yn hawdd arbed sawl e-bost a ddewiswyd ffeil fformat HTML unigol, ffeil fformat TXT, dogfen Word, ffeil CSV yn ogystal â ffeil PDF yn Outlook fel y dangosodd isod screenshot. Dadlwythwch a rhowch gynnig arni nawr! (llwybr am ddim 60 diwrnod)


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 (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
It doesn't seem to work when emails are displayed in conversation mode or from a Group folder.
This comment was minimized by the moderator on the site
Hi, i am new to macro. i am looking for a macro that allows me to save the filename, not by subject or time. But by the reference # found inside the email body. This macro works well when i save multiple emails into my folder. But as i want each email to be saved using the reference #, would you have a macro for it? The reference # is found on the 6th row of the emails body (REF : WL344ET2), that i received everyday. Appreciate if anyone can help on this and thank you in advance.
This comment was minimized by the moderator on the site
When there is a ":" in the subject, this code cannot copy the whole subject to be the name of the saved message, is there any way to solve this problem?
This comment was minimized by the moderator on the site
change line 21 to xName="". The saved message filname will not include the subject anymore.
This comment was minimized by the moderator on the site
A better way is to always replace ":" with blanks adding this line under xName = xMail.Subject

xName = Replace(xName, ":", "")
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations