Skip to main content

Conas gach fofhillteán a oscailt ó Outlook?

Má chruthaíonn tú ilfhofhillteáin faoi d’fhillteáin Outlook, conas a d’fhéadfá na fofhillteáin seo go léir a oscailt nó a leathnú láithreach? An t-alt seo, tabharfaidh mé isteach cód VBA úsáideach duit chun an post seo a réiteach.

Oscail nó leathnaigh gach fofhillteán ó Outlook le cód VBA


Oscail nó leathnaigh gach fofhillteán ó Outlook le cód VBA

Cuir an cód VBA seo a leanas i bhfeidhm chun na fofhillteáin uile a leathnú ó gach cuntas Outlook:

1. Coinnigh síos an ALT + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Cliceáil Ionsáigh > Modúil, agus greamaigh an macra seo a leanas i bhFuinneog an Mhodúil.

Cód VBA: Oscail gach fofhillteán ó Outlook:

Sub ExpandAllMailFolders()
    Dim xCurrentFolder As Folder
    Dim xAllFolders As Folders
    Dim xFolder As Folder
    On Error Resume Next
    Set xCurrentFolder = Application.ActiveExplorer.CurrentFolder
    Set xAllFolders = Application.Session.Folders
    For Each xFolder In xAllFolders
        Call ProcessFolders(xFolder)
    Next
    Set Application.ActiveExplorer.CurrentFolder = xCurrentFolder
End Sub
Sub ProcessFolders(ByVal CurFolder As Folder)
    Dim xSubfolder As Folder
    On Error Resume Next
    If CurFolder.DefaultItemType <> olMailItem Then Exit Sub
    Set Application.ActiveExplorer.CurrentFolder = CurFolder
    DoEvents
    If CurFolder.Folders.Count = 0 Then Exit Sub
    For Each xSubfolder In CurFolder.Folders
        Call ProcessFolders(xSubfolder)
    Next
End Sub

3. Ansin brúigh F5 eochair chun an cód seo a rith, agus leathnaíodh gach fofhillteán i ngach cuntas de do Outlook, féach an scáileán:

fofhillteáin a leathnú 1


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 (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Guten Abend,

habe das o.g. Makro ausgetestet und es funktioniert super, ABER...

könnte man auch sagen öffne nur die Unterordner eines bestimmten Hauptordners?
Wenn ja, wie?

Vielen Dank!
This comment was minimized by the moderator on the site
Hello, Sandra,
To only open the subfolders from a specific folder, please apply the below code:
Sub ExpandAllMailFolders()
    Dim xCurrentFolder As Folder
    Dim xFolder As Folder
    On Error Resume Next
    Set xCurrentFolder = Application.ActiveExplorer.CurrentFolder
    Set xFolder = Application.Session.PickFolder
    If xFolder Is Nothing Then Exit Sub
    Call ProcessFolders(xFolder)
    Set Application.ActiveExplorer.CurrentFolder = xCurrentFolder
End Sub
Sub ProcessFolders(ByVal CurFolder As Folder)
    Dim xSubfolder As Folder
    On Error Resume Next
    If CurFolder.DefaultItemType <> olMailItem Then Exit Sub
    Set Application.ActiveExplorer.CurrentFolder = CurFolder
    DoEvents
    If CurFolder.Folders.Count = 0 Then Exit Sub
    For Each xSubfolder In CurFolder.Folders
        Call ProcessFolders(xSubfolder)
    Next
End Sub

Please try, hope it can help you!
This comment was minimized by the moderator on the site
I have been looking for this answer for a long time! Thank you.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations