高度な検索方法を使用して、多数のメールをフィルタリングしようとしています。私は最終的に次のようなフィルターを作成することを検討しています:
filter = "(urn:schemas:mailheader:subject like '%project%' or " _
& "urn:schemas:httpmail:textdescription like '%project%') and " _
& "urn:schemas:mailheader:date > 'now - 1:00:00' and " _
& "urn:schemas:httpmail:hasattachment > 0 and " _
**& "urn:schemas:httpmail:attachmentfilename like '%tonnage%'"**
問題は、添付ファイルのファイル名の部分 (太字の行) が機能しないことです。これはおそらく、そのオブジェクトへの添付ファイルではなく、olmailitem のようなものを探しているためだと思います。とにかく、添付ファイルの動作を確認する単純なフィルターを取得する必要があり、それをスケールアップできます。これは私がこれまでに持っているものです:
scope = "'Fakeexample123@outlook.com'"
'this is a dumbed down version of my filter,
'but I want it to search for 3 instances of '%attachment%':
'attachment
'Attachment
'ATTACHMENT
'for any .xls, .xlsm, or .xlsx files
'I was thinking something like:
'filter = "ucase(urn:schemas:httpmail:attachmentfilename) like '%ATTACHMENT%xls%'"
'but I don't believe that works... ideas?
filter = "urn:schemas:httpmail:hasattachment > 0 and " _
'***************** This is the line that is giving me trouble *****************
"urn:schemas:httpmail:attachmentfilename like '%attachment%xls%'"
'***************** End trouble *****************
Set AdvancedSearch = myOlApp.AdvancedSearch(scope, filter, True, "test")
何か考えがあれば教えてください。