Skip to main content

Conas iliomad ríomhphoist roghnaithe a shábháil mar chomhaid MSG ar an mórchóir in Outlook?

Údar: Siluvia Athraithe Deiridh: 2020-07-22

Is furasta ríomhphost a shábháil mar chomhad MSG in Outlook. Conas is féidir leat iliomad ríomhphoist roghnaithe a shábháil mar chomhaid MSG aonair ar an mórchóir in Outlook? Taispeánfaidh an t-alt seo modh duit chun é a bhaint amach.

Sábháil ríomhphoist roghnaithe iomadúla mar chomhaid MSG le cód VBA


Sábháil ríomhphoist roghnaithe iomadúla mar chomhaid MSG le cód VBA

Is féidir leis an gcód VBA seo a leanas cabhrú leat iliomad ríomhphoist roghnaithe a shábháil mar chomhaid MSG aonair ar an mórchóir in Outlook. Déan mar a leanas le do thoil.

1. Roghnaigh na ríomhphoist is mian leat a shábháil mar chomhaid MSG. Ansin brúigh na heochracha Alt + F11 ag an am céanna chun an fhuinneog Microsoft Visual Basic for Applications a oscailt.

2. I bhfuinneog Microsoft Visual Basic for Applications, cliceáil Ionsáigh> Modúl, agus ansin cóipeáil faoi bhun an chóid VBA isteach i bhfuinneog an Mhodúil.

Cód VBA: Sábháil iliomad ríomhphoist roghnaithe mar chomhaid MSG aonair in 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. Brúigh an eochair F5 chun an cód a rith.

4. Sa bhosca dialóige Brabhsáil Chun Fillteán, sonraigh fillteán le do thoil chun na comhaid MSG a shábháil agus ansin cliceáil ar an OK cnaipe. Féach an pictiúr:

Anois sábhálfar gach ríomhphost roghnaithe mar chomhaid aonair MSG mar a thaispeántar thíos.


Sábháil ríomhphoist roghnaithe go héasca mar chomhaid bhformáid dhifriúla in Outlook:

Leis an Sábháil Bulc fóntais de Kutools le haghaidh Outlook, is féidir leat comhaid ríomhphoist aonair aonair, comhad formáide TXT, doiciméad Word, comhad CSV chomh maith le comhad PDF in Outlook a shábháil mar a thaispeántar thíos. Íoslódáil agus bain triail as anois! (trasáil saor in aisce 60 lá)


Uirlisí Táirgiúlachta Oifige is Fearr

Kutools le haghaidh Outlook - Níos mó ná 100 Gnéithe cumhachtacha chun do Outlook a shárú

🤖 Cúntóir Ríomhphoist AI: Ríomhphoist pro toirt le draíocht AI - aon-cliceáil chun freagraí genius, ton foirfe, máistreacht ilteangach. Trasfhoirmigh ríomhphost gan stró! ...

📧 Uathoibriú Ríomhphoist: As Oifig (Ar fáil do POP agus IMAP)  /  Sceideal Seol Ríomhphoist  /  Auto CC/BCC de réir Rialacha Agus Ríomhphost á Sheoladh  /  Auto Ar Aghaidh (Ardrialacha)   /  Beannacht Auto Cuir leis   /  Scoilt Ríomhphoist Ilfhaighteoirí go huathoibríoch i dTeachtaireachtaí Aonair ...

📨 Bainistíocht Ríomhphost: Ríomhphoist a Athghairm go héasca  /  Bloc Ríomhphoist Scam ag Ábhair agus Daoine Eile  /  Scrios Ríomhphoist Dúblacha  /  Cuardach Casta  /  Comhdhlúthaigh Fillteáin ...

📁 Ceangaltáin ProSábháil Baisc  /  Baisc Dícheangail  /  Comhbhrú Baisc  /  Auto Sábháil   /  Auto Dícheangail  /  Comhbhrúite Auto ...

🌟 Draíocht Chomhéadain: 😊Níos mó Emojis Pretty and Cool   /  Treisiú Do Tháirgiúlacht Outlook le Radhairc Tabbed  /  Íoslaghdaigh Outlook In ionad Deiridh ...

???? Wonders aon-cliceáil: Freagair Gach Duine le Ceangaltáin Isteach  /   Ríomhphoist Frith-Iascaireachta  /  🕘 Taispeáin Crios Ama an tSeoltóra ...

👩🏼‍🤝‍👩🏻 Teagmhálaithe & Féilire: Baisc Cuir Teagmhálacha Ó Ríomhphoist Roghnaithe  /  Roinn Grúpa Teagmhála ar Ghrúpaí Aonair  /  Bain Meabhrúcháin Breithlá ...

Thar Gnéithe 100 Fan le do Thaiscéalaíocht! Cliceáil Anseo le Tuilleadh Amach.

 

 

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