Загрузить повторяющиеся встречи, но дата начала всех встреч показывает первую ту же датуPython

Программы на Python
Anonymous
Загрузить повторяющиеся встречи, но дата начала всех встреч показывает первую ту же дату

Сообщение Anonymous »


I am trying to get all appointments from client outlook with python and win32com. client, there are several recurring appointments in calendar A. however, when I download these recurring appointments through python, it only shows the 1st appointment start date instead of each different dates. IncludeRecurrences = True was used in my coding; how can i modify my python coding? thanks

Example: a recurring appointment happens on the first of every month in 2024. I want to show 12 INSTANCES, with 12 DIFFERENT start dates (01/01/2024, 02/01/2024, etc) but currently only shows 01/01/2024 and repeat 12 times.
import win32com.client, datetime import time import os import email import imaplib import pandas as pd import xlsxwriter import datetime as dt import calendar as ccc from datetime import timedelta MailboxToAccess = "my_mail@outlook.com" outlook = win32com.client.Dispatch('Outlook.Application').GetNamespace('MAPI') recip = outlook.CreateRecipient(MailboxToAccess) mail_box = outlook.Folders["A_mailbox"] calendar = mail_box.Folders["Calendar"].Items calendar.IncludeRecurrences = True calendar.Sort('[Start]') _today=datetime.date.today()[enter image description here](Изображение) first_day = datetime.date(_today.year, _today.month, 1) this_month_end = datetime.datetime(_today.year, _today.month, ccc.monthrange(_today.year, _today.month)[1]) restriction = "[Start] >= '" + str(first_day) + "' AND [END]

Источник: https://stackoverflow.com/questions/780 ... st-same-da

Вернуться в «Python»