Я могу получать все встречи из своего основного календаря, например:
def getCalendarEntries():
Outlook = win32com.client.Dispatch("Outlook.Application")
ns = Outlook.GetNamespace("MAPI")
appointments = ns.GetDefaultFolder(9).Items
appointments.Sort("[Start]")
appointments.IncludeRecurrences = "True"
begin = datetime.date.today()
end = begin + datetime.timedelta(days = 100);
restriction = "[Start] >= '" + begin.strftime("%m/%d/%Y") + "' AND [End] <= '" +end.strftime("%m/%d/%Y") + "'"
restrictedItems = appointments.Restrict(restriction)
events={'Start':[],'End':[],'Organizer':[],'Subject':[],'Duration':[]}
for a in restrictedItems:
events['Start'].append(a.Start)
events['End'].append(a.End)
events['Organizer'].append(a.Organizer)
events['Subject'].append(a.Subject)
events['Duration'].append(a.Duration)
return events
И я могу сохранять события в своем основном календаре, например:
def addevent(start, subject, duration):
Outlook = win32com.client.Dispatch("Outlook.Application")
appointment = Outlook.CreateItem(1) # 1=outlook appointment item
appointment.Start = start
appointment.Subject = subject
appointment.Duration = duration
appointment.Save()
Моя проблема что я не знаю, как подключиться к другой папке календаря. Я не хочу "DefaultFolder", а указать c. Я был бы очень признателен, если бы кто-нибудь мог мне помочь.