跳到主要內容

如何在Outlook中按名稱查找文件夾?

例如,您已經在Outlook中創建了許多電子郵件文件夾,當需要打開指定的個人文件夾時,您必須展開多個文件夾,直到顯示該指定的文件夾為止。 僅為了打開指定的個人文件夾而一個接一個地擴展多個文件夾是很麻煩的。 實際上,如果您記住了文件夾名稱,所有內容將變得很容易。 在本教程中,我們將為您提供一種在Outlook中按名稱查找文件夾的方法,而不是一個個地展開文件夾以查找文件夾。

使用VBA代碼在Outlook中按名稱查找文件夾

通過Kutools for Outlook在Outlook中跨帳戶按名稱搜索文件夾好主意3


箭頭藍色右氣泡 使用VBA代碼在Outlook中按名稱查找文件夾

使用以下VBA代碼,您可以通過名稱輕鬆找到指定的文件夾。

備註注意:要使用此VBA代碼,您需要記住文件夾名稱。

1。 按 其他 + F11 鍵盤上的按鍵打開 Microsoft Visual Basic for Applications 窗口。

2.然後雙擊 Project1 > Microsoft Outlook對象 > 本次展望會議 打開 項目1 – ThisOutlookSession 窗口。 看截圖:

3.將以下VBA代碼複製並粘貼到Project1 – ThisOutlookSession窗口中。

VBA:按名稱查找文件夾

Sub FindFolderByName()
    Dim Name As String
    Dim FoundFolder As Folder
    
    Name = InputBox("Find Name:", "Search Folder")
    If Len(Trim$(Name)) = 0 Then Exit Sub
    
    Set FoundFouder = FindInFolders(Application.Session.Folders, Name)
    
  If Not FoundFouder Is Nothing Then
    If MsgBox("Activate Folder: " & vbCrLf & FoundFouder.FolderPath, vbQuestion Or vbYesNo) = vbYes Then
      Set Application.ActiveExplorer.CurrentFolder = FoundFouder
    End If
  Else
    MsgBox "Not Found", vbInformation
  End If
End Sub
Function FindInFolders(TheFolders As Outlook.Folders, Name As String)
  Dim SubFolder As Outlook.MAPIFolder
  
  On Error Resume Next
  
  Set FindInFolders = Nothing
  
  For Each SubFolder In TheFolders
    If LCase(SubFolder.Name) Like LCase(Name) Then
      Set FindInFolders = SubFolder
      Exit For
    Else
      Set FindInFolders = FindInFolders(SubFolder.Folders, Name)
      If Not FindInFolders Is Nothing Then Exit For
    End If
  Next
End Function 

4.然後按 F5 鍵盤上的鍵運行VBA代碼。

5。 在裡面 對話框中,單擊 按鈕。

6.在彈出 搜索文件夾 對話框,請在文本框中輸入文件夾名稱,然後單擊 OK 按鈕。 看截圖:

7.然後 微軟Outlook 彈出對話框,顯示所需文件夾的路徑,然後單擊 按鈕。

8.然後,將立即打開指定的電子郵件文件夾。

備註:此VBA代碼可以應用於Outlook 2007、2010和2013。


箭頭藍色右氣泡 通過Kutools for Outlook在Outlook中跨帳戶按名稱搜索文件夾

如果您不擅長VBA,可以嘗試 Kutools for Outlook's 轉到 實用程序,可以查找和搜索具有名稱或特定字符的文件夾,然後直接轉到該文件夾

Kutools for Outlook , 包括 Microsoft Outlook 2016、2013、2010和Office 365的強大功能和工具。

免費安裝 Kutools for Outlook,然後執行以下步驟:

1。 點擊 Kutools 加 > 轉到.
doc按名稱查找文件夾5

2。 在裡面 轉到 在對話框中,在搜索欄中鍵入文件夾名稱或特定字符,然後列出相關文件夾。
doc按名稱查找文件夾6

3.雙擊要打開的文件夾名稱,然後打開該文件夾。
doc按名稱查找文件夾7


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

📁 附件專業版批量保存  /  批量分離  /  批量壓縮  /  自動保存   /  自動分離  /  自動壓縮 ...

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

閱讀更多       免費下載      購買
 

 

Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, 6 years later but have same issues as raised by the others. I once had this code but sadly lost it. Any ideas (i will try AI)
This comment was minimized by the moderator on the site
It looks great but I'm looking more folder with similar name....
This comment was minimized by the moderator on the site
I am currently working with Outlook 2013, and while this tool is wonderfully helpful, I'm in the same boat as Matt and Richard. I would like to be able to somehow go through multiple folders with the same name. I would also like to be able to do this: if I have multiple folders with dates, 2012,2013,2014 for example, I would like to be able to put in 20* or 20?? and then be prompted to view any of the aforementioned folders, instead of just defaulting to the first one it finds.
This comment was minimized by the moderator on the site
The line "Function FindInFolders(TheFolders As Outlook.Folders, Name As String)" is throwing a compile error message - User-defined type not defined
This comment was minimized by the moderator on the site
the line "Function FindInFolders(TheFolders As Outlook.Folders, Name As String)" is throwing a Compile error message: User-defined type not defined
This comment was minimized by the moderator on the site
Just like Matt wrote, I was also looking for this. The way the code operates is that it will open the first folder it finds with the name to search for. Is it possible to adjust the code so it will find multiple instances?
This comment was minimized by the moderator on the site
Is there a way to add folder iteration to the above code. Say the user has multiple folders named Employee, is it possible for it to go through a loop to find all instances and allow user to select appropriate folder?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations