[英]Check if there is any mail in an outlook folder received yesterday
I need to check and verify if there is any mail received in a specific outlook folder on the day before using python code. 在使用python代码之前,我需要检查并确认在特定的Outlook文件夹中是否收到任何邮件。
I am able to access folder and read mails. 我能够访问文件夹并阅读邮件。 But somehow, latest mail is not read when I tried GetLast() method.
但是以某种方式,当我尝试使用GetLast()方法时不会读取最新的邮件。 I use win32com module and Outlook MAPI object to do this.
我使用win32com模块和Outlook MAPI对象来执行此操作。
Is there any way to check if there are mails received on yesterday? 有什么办法可以检查昨天是否收到邮件?
使用Items.Restrict
:
yesterdaysItems = MAPIFolder.Items.Restrict("@SQL=(ReceivedTime < '7/21/2016') AND (ReceivedTime > '7/20/2016') ")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.