Python - Outlook 响应(接受、拒绝等)Date/Time
Python - Outlook Response (Accept, Reject, etc.) Date/Time
我正在从事一个项目,该项目涉及从多个人的 Outlook 中提取大量 appointment/meeting 数据。我要查找的一条信息是 每个 与会者的回复,如果可能的话,还有回复发生的日期和时间。例如,如果某人 X 在 2015 年 4 月 21 日 12:31:00 下午向我发送会议请求,而我在 2015 年 4 月 21 日 1:30:00 下午接受了会议请求,我将如何获得后者两次?我一直在为此浏览 Microsoft 文档 (Link),但到目前为止运气不好。
以下是 Python 中的简要摘要:
import win32com.client
outlook = win32com.client.Dispatch('Outlook.Application')
namespace = outlook.GetNamespace('MAPI')
recipient = namespace.createRecipient('Other Person')
resolved = recipient.Resolve()
sharedCalendar = namespace.GetSharedDefaultFolder(recipient, 9)
appointments = sharedCalendar.Items
for i in range(0,1):
print appointments[i]
print appointments[i].start
print appointments[i].end
print appointments[i].organizer
print appointments[i].location
print appointments[i].duration
for j in range(0,len(appointments[i].recipients)):
print 'recip, status: ' + str(appointments[i].recipients[j]) + ', ' + str(appointments[i].recipients[j].TrackingStatusTime)
AppointmentItem.ReplyTime and AppointmentItem.ResponseStatus
这是另一种方式
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
messages.Sort("[ReceivedTime]", True)
for i, msg in enumerate(messages):
print(msg.MessageClass) # use this in condition
if msg.MessageClass=='IPM.Note':
print('This a Meeting')
elif msg.MessageClass =='IPM.Schedule.Meeting.Request':
print('This is a meeting Meeting')
elif msg.MessageClass =='IPM.Schedule.Meeting.Resp.Pos':
print('Accepted Response , POS = Positive')
elif msg.MessageClass =='IPM.Schedule.Meeting.Resp.Tent':
print('Accepted as Tentative ')
elif msg.MessageClass == 'IPM.Schedule.Meeting.Resp.Neg':
print('Declined Meeting , Neg = Negative')
# Check only first 10 items, change the number as per requirement
if i > 10:
break
https://docs.microsoft.com/en-us/office/vba/outlook/Concepts/Forms/item-types-and-message-classes
我正在从事一个项目,该项目涉及从多个人的 Outlook 中提取大量 appointment/meeting 数据。我要查找的一条信息是 每个 与会者的回复,如果可能的话,还有回复发生的日期和时间。例如,如果某人 X 在 2015 年 4 月 21 日 12:31:00 下午向我发送会议请求,而我在 2015 年 4 月 21 日 1:30:00 下午接受了会议请求,我将如何获得后者两次?我一直在为此浏览 Microsoft 文档 (Link),但到目前为止运气不好。
以下是 Python 中的简要摘要:
import win32com.client
outlook = win32com.client.Dispatch('Outlook.Application')
namespace = outlook.GetNamespace('MAPI')
recipient = namespace.createRecipient('Other Person')
resolved = recipient.Resolve()
sharedCalendar = namespace.GetSharedDefaultFolder(recipient, 9)
appointments = sharedCalendar.Items
for i in range(0,1):
print appointments[i]
print appointments[i].start
print appointments[i].end
print appointments[i].organizer
print appointments[i].location
print appointments[i].duration
for j in range(0,len(appointments[i].recipients)):
print 'recip, status: ' + str(appointments[i].recipients[j]) + ', ' + str(appointments[i].recipients[j].TrackingStatusTime)
AppointmentItem.ReplyTime and AppointmentItem.ResponseStatus
这是另一种方式
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
messages.Sort("[ReceivedTime]", True)
for i, msg in enumerate(messages):
print(msg.MessageClass) # use this in condition
if msg.MessageClass=='IPM.Note':
print('This a Meeting')
elif msg.MessageClass =='IPM.Schedule.Meeting.Request':
print('This is a meeting Meeting')
elif msg.MessageClass =='IPM.Schedule.Meeting.Resp.Pos':
print('Accepted Response , POS = Positive')
elif msg.MessageClass =='IPM.Schedule.Meeting.Resp.Tent':
print('Accepted as Tentative ')
elif msg.MessageClass == 'IPM.Schedule.Meeting.Resp.Neg':
print('Declined Meeting , Neg = Negative')
# Check only first 10 items, change the number as per requirement
if i > 10:
break
https://docs.microsoft.com/en-us/office/vba/outlook/Concepts/Forms/item-types-and-message-classes