Ana içeriğe atla

Outlook'taki tüm boş klasörleri toplu olarak nasıl silebilirim?

Outlook'ta bir posta klasörünün altında düzinelerce boş klasör olduğunu varsayalım, genellikle menüyü sağ tıklayarak boş klasörleri tek tek silebiliriz. Tekrar tekrar sağ tıklama ile karşılaştırıldığında, bu makale bir Outlook klasörünün tüm boş alt klasörlerini toplu olarak hızlı bir şekilde silmek için bir VBA tanıtacaktır.

Outlook'taki tüm boş klasörleri VBA ile toplu olarak silin

Office Sekmesi - Microsoft Office'te Sekmeli Düzenlemeyi ve Göz Atmayı Etkinleştirerek Çalışmayı Kolaylaştırın
Kutools for Outlook - Üstün Verimlilik için Outlook'u 100'den Fazla Gelişmiş Özellikle Güçlendirin
Bu gelişmiş özelliklerle Outlook 2021 - 2010 veya Outlook 365'inizi güçlendirin. Kapsamlı 60 günlük ücretsiz deneme sürümünün keyfini çıkarın ve e-posta deneyiminizi geliştirin!

ok mavi sağ balonOutlook'taki tüm boş klasörleri VBA ile toplu olarak silin

Belirli bir Outlook klasörünün tüm boş alt klasörlerini kaldırmak için lütfen aşağıdakileri yapın:

1. Basın Ara Toplam + F11 Microsoft Visual Basic for Applications penceresini açmak için tuşlar.

2. tıklayın Ekle > modülve yeni modül penceresine VBA kodunun altına yapıştırın.

VBA: Belirli Outlook klasörünün tüm boş alt klasörlerini toplu olarak silin

Public Sub DeletindEmtpyFolder()
Dim xFolders As Folders
Dim xCount As Long
Dim xFlag As Boolean
Set xFolders = Application.GetNamespace("MAPI").PickFolder.Folders
Do
FolderPurge xFolders, xFlag, xCount
Loop Until (Not xFlag)
If xCount > 0 Then
MsgBox "Deleted " & xCount & "(s) empty folders", vbExclamation + vbOKOnly, "Kutools for Outlook"
Else
MsgBox "No empty folders found", vbExclamation + vbOKOnly, "Kutools for Outlook"
End If
End Sub

Public Sub FolderPurge(xFolders, xFlag, xCount)
Dim I As Long
Dim xFldr As Folder 'Declare sub folder objects
xFlag = False
If xFolders.Count > 0 Then
For I = xFolders.Count To 1 Step -1
Set xFldr = xFolders.Item(I)
If xFldr.Items.Count < 1 Then 'If the folder is empty check for subfolders
If xFldr.Folders.Count < 1 Then 'If the folder contains not sub folders confirm deletion
xFldr.Delete 'Delete the folder
xFlag = True
xCount = xCount + 1
Else 'Folder contains sub folders so confirm deletion
FolderPurge xFldr.Folders, xFlag, xCount
End If
Else 'Folder contains items or (subfolders that may be empty).
FolderPurge xFldr.Folders, xFlag, xCount
End If
Next
End If
End Sub

3. Basın F5 Anahtar veya koşmak Bu VBA kodunu çalıştırmak için düğmeye basın.

4. Açılan Klasör Seç iletişim kutusunda, lütfen boş alt klasörlerini toplu olarak sileceğiniz belirli klasörü seçin ve OK buton. Ekran görüntüsüne bakın:

5. Şimdi bir Kutools for Outlook iletişim kutusu çıkıyor ve kaç tane boş alt klasörün silindiğini gösteriyor. Tıkla OK düğmesine basarak kapatın.

Şimdiye kadar, belirtilen Outlook klasörünün tüm alt klasörleri zaten toplu olarak silindi.


ok mavi sağ balonİlgili Makaleler

Outlook'ta klasör adına göre klasörü (tam klasör yolu) bulun


En İyi Ofis Üretkenlik Araçları

Outlook için Kutools - Outlook'unuzu Güçlendirecek 100'den Fazla Güçlü Özellik

🤖 AI Posta Yardımcısı: Yapay zeka büyüsüyle anında profesyonel e-postalar: tek tıkla dahice yanıtlar, mükemmel ton, çok dilli ustalık. E-posta göndermeyi zahmetsizce dönüştürün! ...

???? E-posta Otomasyonu: Ofis Dışında (POP ve IMAP için kullanılabilir)  /  E-posta Gönderimini Planla  /  E-posta Gönderirken Kurallara Göre Otomatik CC/BCC  /  Otomatik İletme (Gelişmiş Kurallar)   /  Otomatik Karşılama Ekleme   /  Çok Alıcılı E-postaları Otomatik Olarak Bireysel Mesajlara Bölün ...

📨 E-posta Yönetimi: E-postaları Kolayca Geri Çağırın  /  Dolandırıcılık E-postalarını Konulara ve Diğerlerine Göre Engelleyin  /  Yinelenen E-postaları Silin  /  gelişmiş Arama  /  Klasörleri Birleştir ...

📁 Ekler ProToplu Kaydetme  /  Toplu Ayır  /  Toplu Sıkıştırma  /  Otomatik kaydet   /  Otomatik Ayır  /  Otomatik Sıkıştır ...

🌟 Arayüz Büyüsü: 😊Daha Fazla Güzel ve Havalı Emoji   /  Sekmeli Görünümlerle Outlook Verimliliğinizi Artırın  /  Outlook'u Kapatmak Yerine Küçültün ...

👍 Tek Tıklamayla Harikalar: Tümünü Gelen Eklerle Yanıtla  /   Kimlik Avına Karşı E-postalar  /  🕘Gönderenin Saat Dilimini Göster ...

👩🏼‍🤝‍👩🏻 Kişiler ve Takvim: Seçilen E-postalardan Toplu Kişi Ekleme  /  Kişi Grubunu Bireysel Gruplara Bölme  /  Doğum Günü Hatırlatıcılarını Kaldır ...

üzerinde 100 Özellikler Keşfinizi Bekleyin! Daha Fazlasını Keşfetmek İçin Buraya Tıklayın.

 

 

Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This worked great for me. Thank you. Some folders cannot be deleted as they are native to Outlook, but the sub-folders work great.
This comment was minimized by the moderator on the site
74 empty folders were deleted but unfortunately also 109 folders that were not. Other empty folders were left untouched.
This comment was minimized by the moderator on the site
Super easy and incredibly helpful. Thank you!!
This comment was minimized by the moderator on the site
I am getting the same error like Bryan.... and now?
This comment was minimized by the moderator on the site
The script tries to delete a folder that was already deleted.
I added a row after xFlag = False with this content:
on error resume next
This comment was minimized by the moderator on the site
I am getting the following error when run the above " Run-time error '-2147352567 (80020009)' Cannot delete this folder. Right-click the folder, and then click properties to check your permissions for the folder. See the folder owner or your administrator to change your permissions"

It appears the script moves 1 item to the deleted folder and then errors out.
This comment was minimized by the moderator on the site
Agree - I get the same error.
This comment was minimized by the moderator on the site
The script tries to delete a folder that was already deleted.
I added a row after xFlag = False with this content:
on error resume next
This comment was minimized by the moderator on the site
Indeed, add:

On Error Resume Next

AFTER:

Dim x Fldr As Folder 'Declare sub folder objects
xFlag = False

It should look like this:

Dim x Fldr As Folder 'Declare sub folder objects
xFlag = False
On Error Resume Next
This comment was minimized by the moderator on the site
Brilliant!!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations