Outlook VBA macro to search by colour category

时光毁灭记忆、已成空白 提交于 2021-02-05 07:47:26

问题


I want to make a VBA macro to search ALL folders including my online archive by colour category RED

Don't have a clue where to start with this!

I have a text search one but this obviously doesn't do colours.

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

回答1:


did you tried:

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

Complete:

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


来源:https://stackoverflow.com/questions/47791242/outlook-vba-macro-to-search-by-colour-category

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!