使用python检查Outlook中会议室的可用性 [英] check availability of meeting rooms in outlook with python
问题描述
我正在编写一个python脚本,以检查特定的会议室是否可用.如果是,则将预订会议室;如果否,则python将找到当天的可用时间段.
I am working on to write a python script to check if particular meeting room is available. If yes then meeting room will be booked, if not then python will find available time slot for that day.
目前,我已经预订了会议室,但无法检查房间的可用性.
For now, I have achieved to book meeting room but I am not able to check availability of rooms.
要预订任何会议室,我必须将邮件发送到该会议室,该会议室配置了邮件ID和我根据可用性收到的相应的接受/拒绝邮件.
To book any meeting room, i have to send mail to that book meeting room configured mail id and corresponding acceptance/decline mail I receive as per the availability.
下面是代码段:
import win32com.client
import datetime
import pywintypes
oOutlook = win32com.client.Dispatch("Outlook.Application")
appt = oOutlook.CreateItem(1)
appt.Start = '2018-05-18 13:30'
appt.Subject = 'Follow Up Meeting'
appt.Duration = 30
appt.Location = '<name of meeting room>'
appt.MeetingStatus = 1
myRecipient = appt.Recipients.Add("<mail id of meeting room")
myRecipient.resolve
my_date = datetime.date(2018,5,18)
pywintypeDate = pywintypes.Time (my_date)
availabilityInfo = myRecipient.FreeBusy(pywintypeDate,30,True)
print(availabilityInfo)
# appt.Save()
# appt.Send()
# print("done")
输出为:
000000000000000000000222222200222222022000000000000000000000000000000002222222222220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000002220002222200000000000000000000000000000000002220022022222000000000000000000000000000000000000000000002222000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000222222200000000000000000000000000000000002220000022000000000000000000000000000000000000002220000222222000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000002220022022200000000000000000000000000000000000022000022000000000000000000000000000000000000000000000002222000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000022022200000000000000000000000000000000002220002222000000000000000
那么它的第一个字节(0)是否指示从00:00到00:30的时隙,并且很快就会整整一个月?
so is it first byte (0) indicate time slot from 00:00 to 00:30 and soon for one complete month ?
是否可以只输出一天?
我是否必须解析以上输出以检查我的特定所需时间的可用性?
Do i have to parse the above output to check availability for my particular required time ?
推荐答案
appt.Recipients.Add
返回Recipient
对象.首先解决它(Recipient.Resolve
),然后调用
appt.Recipients.Add
returns the Recipient
object. Resolve it first (Recipient.Resolve
), then call Recipient.FreeBusy.
这篇关于使用python检查Outlook中会议室的可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!