首页 > 解决方案 > 如何在搜索字段中输入字符串?

问题描述

我想在 Outlook 主窗口的搜索栏中输入一个字符串。

这就是我所说的搜索栏

作为第一步,输入字符串就足够了。

一个字符串的例子是: category:="Urgent" received:this week

我已经用 View 对象和 DASL 过滤器做了一些尝试。

标签: vbasearchoutlook

解决方案


尝试这个

Sub showMailviaRef()

Dim refCode As String ' define your reference

refCode = Selection ' Referance code selection in your excel sheet

With Outlook.ActiveExplorer

.ClearSearch ' Clear previous search if any
.Search refCode, olSearchScopeAllFolders
.Display 'Shows search results

 End With

 End Sub

推荐阅读