Skip to content

Instantly share code, notes, and snippets.

@mursts
Created October 6, 2014 08:46
Show Gist options
  • Save mursts/378711fb85ab1702d501 to your computer and use it in GitHub Desktop.
Save mursts/378711fb85ab1702d501 to your computer and use it in GitHub Desktop.
Outlookに予定を追加します
#!/usr/bin/env python
# coding: utf-8
import win32com.client
import datetime
def add_outlook_schedule():
APPOINTMENT_ITEM = 1
outlook = win32com.client.Dispatch("Outlook.Application")
mapi = outlook.GetNamespace("MAPI")
item = outlook.CreateItem(APPOINTMENT_ITEM)
item.Start = datetime.datetime.today()
item.Duration = 30
item.Subject = '定例ミーティング'.decode('utf-8')
item.Body = 'いつものミーティング'.decode('utf-8')
item.ReminderMinutesBeforeStart = 0
item.ReminderSet = True
item.Save()
if __name__ == '__main__':
add_outlook_schedule()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment