跳到主要内容

如何在Outlook中按名称查找文件夹?

例如,您已经在Outlook中创建了许多电子邮件文件夹,当需要打开指定的个人文件夹时,您必须展开多个文件夹,直到显示该指定的文件夹为止。 仅为了打开指定的个人文件夹而一个接一个地扩展多个文件夹是很麻烦的。 实际上,如果您记住了文件夹名称,所有内容将变得很容易。 在本教程中,我们将为您提供一种在Outlook中按名称查找文件夹的方法,而不是一个一个地展开文件夹来查找文件夹的方法。

使用VBA代码在Outlook中按名称查找文件夹

通过 Kutools for Outlook 在 Outlook 中跨帐户按名称搜索文件夹好主意3


箭头蓝色右气泡 使用VBA代码在Outlook中按名称查找文件夹

使用以下VBA代码,您可以通过名称轻松找到指定的文件夹。

备注注意:要使用此VBA代码,您需要记住文件夹名称。

1。 按 其他 + F11 键盘上的按键打开 Microsoft Visual Basic应用程序 窗口。

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