Read the complete article on how to create MS Outlook tasks programmatically in Python: https://blog.aspose.com/2022/04/28/create-ms-outlook-tasks-in-python/
Last active
April 28, 2022 17:50
-
-
Save aspose-com-gists/e671798a702d48e70070f7558eb156d9 to your computer and use it in GitHub Desktop.
Create MS Outlook Tasks in Python | Add Reminder and Recurrence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.email import MapiTask, MapiCalendarDailyRecurrencePattern, MapiCalendarRecurrencePatternType, TaskSaveFormat | |
import datetime as dt | |
# Create a new task | |
task = MapiTask("To Do", "Just click and type to add new task", dt.datetime(2018, 6, 1, 21, 30, 0), dt.datetime(2018, 6, 4, 21, 30, 0)) | |
# Set the weekly recurrence | |
rec = MapiCalendarDailyRecurrencePattern() | |
rec.pattern_type = MapiCalendarRecurrencePatternType.DAY | |
rec.period = 1 | |
rec.week_start_day = 0 #0 is for Sunday and so on. WeekStartDay=0 | |
rec.occurrence_count = 0 | |
task.recurrence = rec | |
# Save task | |
task.save("task.msg", TaskSaveFormat.MSG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.email import MapiTask, TaskSaveFormat | |
import datetime as dt | |
# Create a new task | |
task = MapiTask("To Do", "Just click and type to add new task", dt.datetime(2018, 6, 1, 21, 30, 0), dt.datetime(2018, 6, 4, 21, 30, 0)) | |
# Set task reminder | |
task.reminder_set = True | |
task.reminder_time = dt.datetime(2018, 6, 1, 21, 30, 0) | |
task.reminder_file_parameter ="file://Alarm01.wav" | |
# Save task | |
task.save("task.msg", TaskSaveFormat.MSG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.email import MapiTask, MapiTaskHistory, MapiTaskOwnership, MapiSensitivity, MapiTaskStatus, TaskSaveFormat | |
import datetime as dt | |
# Create a new task | |
task = MapiTask("To Do", "Just click and type to add new task", dt.datetime(2018, 6, 1, 21, 30, 0), dt.datetime(2018, 6, 4, 21, 30, 0)) | |
# Set task properties | |
task.percent_complete = 20 | |
task.estimated_effort = 2000 | |
task.actual_effort = 20 | |
task.history = MapiTaskHistory.ASSIGNED | |
task.last_update = dt.datetime(2018, 6, 1, 21, 30, 0) | |
task.users.owner = "Darius" | |
task.users.last_assigner = "Harkness" | |
task.users.last_delegate = "Harkness" | |
task.users.ownership = MapiTaskOwnership.ASSIGNERS_COPY | |
task.companies = [ "company1", "company2", "company3" ] | |
task.categories = [ "category1", "category2", "category3" ] | |
task.mileage = "Some test mileage" | |
task.billing = "Test billing information" | |
task.users.delegator = "Test Delegator" | |
task.sensitivity = MapiSensitivity.PERSONAL | |
task.status = MapiTaskStatus.COMPLETE | |
task.estimated_effort = 5 | |
# Save task | |
task.save("task.msg", TaskSaveFormat.MSG) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment