Skip to main content

Conas ríomhphoist Outlook a shábháil go huathoibríoch chuig tiomántán crua / diosca?

Chun cúltaca, fianaise oibre, nó críocha eile, b’fhéidir gur mhaith leat ríomhphoist Outlook a shábháil ar thiomáint crua. Is furasta roinnt ríomhphoist a shábháil ar dhiosca le tarraingt de láimh ó Outlook go diosca. An bhfuil a fhios agat, áfach, conas gach ríomhphost a thagann isteach a shábháil go diosca go huathoibríoch? Tabharfaidh an t-alt seo VBA isteach chun é a láimhseáil in Outlook.

Sábháil ríomhphoist Outlook go huathoibríoch chuig tiomántán crua / diosca


Sábháil ríomhphoist Outlook go huathoibríoch chuig tiomántán crua / diosca

Tabharfaidh an modh seo VBA isteach chun gach ríomhphost a thiocfaidh isteach in Outlook a shábháil go huathoibríoch mar chomhad HTML aonair ar an diosca ar leith. Déan mar a leanas le do thoil:

1. Brúigh Eile + F11 eochracha chun an fhuinneog Microsoft Visual Basic for Applications a oscailt.

2. Leathnaigh an Tionscadal1, agus cliceáil faoi dhó ThisOutlookSession chun é a oscailt, agus ansin greamaigh faoi bhun chód VBA isteach i bhfuinneog ThisOutlookSession. Féach an pictiúr:

VBA: Sábháil ríomhphoist Outlook go huathoibríoch mar chomhaid HTML ar dhiosca

Private WithEvents InboxItems As Outlook.Items
Sub Application_Startup()
Dim xNameSpace As Outlook.NameSpace
Set xNameSpace = Outlook.Application.Session
Set InboxItems = xNameSpace.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub InboxItems_ItemAdd(ByVal objItem As Object)
Dim FSO
Dim xMailItem As Outlook.MailItem
Dim xFilePath As String
Dim xRegEx
Dim xFileName As String
On Error Resume Next
xFilePath = CreateObject("WScript.Shell").SpecialFolders(16)
xFilePath = xFilePath & "\MyEmails"
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(xFilePath) = False Then
FSO.CreateFolder (xFilePath)
End If
Set xRegEx = CreateObject("vbscript.regexp")
xRegEx.Global = True
xRegEx.IgnoreCase = False
xRegEx.Pattern = "\||\/|\<|\>|""|:|\*|\\|\?"
If objItem.Class = olMail Then
Set xMailItem = objItem
xFileName = xRegEx.Replace(xMailItem.Subject, "")
xMailItem.SaveAs xFilePath & "\" & xFileName & ".html", olHTML
End If
Exit Sub
End Sub

3. Sábháil an cód VBA, agus déan do Microsoft Outlook a atosú.

As seo amach, sábhálfar gach ríomhphost a thiocfaidh isteach mar chomhad HTML aonair isteach san fhillteán “MyEmails”.

nótaí:
(1) Cruthóidh an VBA seo fillteán darb ainm “MyEmails” faoin bhfillteán Doiciméid. Is féidir leat na ríomhphoist a shábháiltear go huathoibríoch a fháil amach leis an gcosán fillteáin seo: C: \ Úsáideoirí \ your_user_name \ Documents \ MyEmails
(2) Oibreoidh an VBA seo le ríomhphoist a fhaightear i bhfillteán Isteach an chuntais ríomhphoist réamhshocraithe.


Airteagail gaolmhara


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 (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I need to change the folder for one i created (no need folder inbox), and i need to change the folder to store the msg files, in my case in drive e:., thank!!!
This comment was minimized by the moderator on the site
Can i have a certain report that is emailed to me each week save to a place on my hard drive? Just this one email. Comes from same email address and has the same title each week.
This comment was minimized by the moderator on the site
Could you advise how to change this to another folder, not the Inbox?
This comment was minimized by the moderator on the site
Dzień doby, robię wszystko tak jak opisane powyżej, mimo to makro nie chce działać. Czy muszę włączyć jakieś opcję albo zmienić coś w kodzie?
Nie wywala błędu jednak nie tworzy się folder a plik się nie zapisuje.

Będę bardzo wdzięczna za odpowiedź

Pozdrawiam serdecznie
This comment was minimized by the moderator on the site
How can I add the sender's email address to the file name?
This comment was minimized by the moderator on the site
Buonasera, è possibile modificare questo script con una versione che prevede di spostare i messaggi che arrivano in altra cartella anzichè quella classica della posta in arrivo? In altri termini, vorrei salvare automaticamente le mail che arrivano per esempio in Posta in Arrivo\Cliente1
grazie per la collaborazione
max
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations