如何在 Outlook 中获取搜索文件夹条件 [英] How to get a search folder criteria in Outlook

查看:96
本文介绍了如何在 Outlook 中获取搜索文件夹条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Outlook 中编辑搜索文件夹.但搜索文件夹被视为常规文件夹:在 此 MSDN 参考,MS 通知GetSearchFolders 返回文件夹集合".

我相信,一旦我有了搜索文件夹过滤器,我将不得不删除当前的过滤器,编辑过滤器并创建一个新的过滤器 - 但这是简单的部分.我发现例如这里 如何创建和删除搜索文件夹.我到处都能找到创建和删除,但似乎没有人知道如何编辑它或获取适用于它的过滤器...

I am trying to edit a search folder in Outlook. But a search folder is treated as a regular folder: in this MSDN reference, MS informs that "GetSearchFolders returns a Folders collection".

I believe that, once I have the search folder filter, I will have to delete the current, edit the filter and create a new one - but that's the easy part. I have found e.g. here how to create and delete search folders. Everywhere I find create and delete, but nobody seems to know how to edit it or get the filter that applies to it...

推荐答案

Outlook 对象模型不允许您编辑搜索文件夹的搜索条件.

Outlook Object Model will not let you edit the search criteria of a Search folder.

您可以使用扩展 MAPI(C++ 或 Delphi,您可以在 OutlookSpy 中看到搜索条件,如果您选择搜索文件夹并单击 IMAPIFolder 按钮并转到 GetSearchCriteria 选项卡)或 Redemption(任何语言):它公开 RDOSearchFolder 对象(允许您创建和管理 MAPI 搜索文件夹)和 RDOStore2.Searches 集合 - 它公开搜索下可见的已保存搜索(由 MAPI 搜索文件夹备份)Outlook 中的文件夹节点.

You can either use Extended MAPI (C++ or Delp you can see the search criteria in OutlookSpy if you select the search folder and click the IMAPIFolder button and go to the GetSearchCriteria tab) or Redemption (any language): it exposes the RDOSearchFolder object (lets you create and manage MAPI search folders) and RDOStore2.Searches collection - it exposes saved searches (backed up by MAPI search folders) visible under the Search Folders node in Outlook.

更新:以下脚本将打印默认配置文件中所有搜索的搜索条件:

UPDATE: the following script will print the search criteria of all searches in the default profile:

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Searches = Session.Stores.DefaultStore.Searches
for each Search in Searches
  Debug.Print  "-------------"
  Debug.Print Search.Name & ": "
  Debug.Print Search.SearchCriteria.AsSQL
next

这篇关于如何在 Outlook 中获取搜索文件夹条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆