Skip i'r prif gynnwys

Sut i agor pob is-ffolder o Outlook?

Os ydych chi'n creu is-ffolderi lluosog o dan eich ffolderau Outlook, sut allech chi agor neu ehangu'r holl is-ffolderi hyn ar unwaith? Yr erthygl hon, byddaf yn cyflwyno cod VBA defnyddiol i chi ddatrys y swydd hon.

Agor neu ehangu pob is-ffolder o Outlook gyda chod VBA


Agor neu ehangu pob is-ffolder o Outlook gyda chod VBA

Defnyddiwch y cod VBA canlynol i ehangu'r holl is-ffolderi o'r holl gyfrifon Outlook:

1. Daliwch i lawr y ALT + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y macro canlynol yn y Ffenestr Modiwl.

Cod VBA: Agorwch yr holl is-ffolderi o 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. Yna pwyswch F5 allwedd i redeg y cod hwn, ac mae'r holl is-ffolderi ym mhob cyfrif o'ch Outlook wedi'u hehangu, gweler y screenshot:

doc ehangu is-ffolderi 1


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 (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