我想迭代 Outlook 收件箱,我正在使用 Ruby。
我在这里找到了一些有用的信息,但收件箱中的消息顺序不是按 RecevedTime(Item OLE 对象的属性)排序的。GetLast 方法可能会找到最新消息,但 GetPrevious 方法无法按预期工作。
require 'win32ole'
outlook = WIN32OLE.new('Outlook.Application')
mapi = outlook.GetNameSpace('MAPI')
inbox = mapi.GetDefaultFolder(6)
inbox.Items.GetLast # return the latest message, maybe
inbox.Items.GetPrevious # return nil object and then, what's this method for?
inbox.Items.Sort('ReceivedTime') # is this right usage? if so, what's next?
如何将收件箱中的消息从最新到最旧迭代?