Outlook VBA宏按颜色类别

时间:2017-12-13 10:52:33

标签: vba outlook outlook-vba outlook-2016

我想创建一个VBA宏来搜索所有文件夹,包括按颜色类别RED

搜索我的在线存档

不知道从哪里开始!

我有一个文本搜索,但这显然没有颜色。

Sub SearchMacro()
Dim myOlApp As New Outlook.Application
txtSearch = "category:(Business)"
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

1 个答案:

答案 0 :(得分:2)

你试过了吗?

txtSearch = "category:=""Red category"""

达成:

Sub Red()
Dim myOlApp As New Outlook.Application
txtSearch = "category:=""Red category"""
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub