我正在尝试使用Python 3在Outlook 2007中创建一个约会。 我可以使用纯文本正文创建日历,但不能创建带有HTML文本的正文。没有'CreateItem.HTMLBody'属性
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application")
App = outlook.CreateItem(1) #olAppointmentItem
App.Subject = "Meeting with CEO"
#App.Body = 'Hi Tim, <br><br>Kindly attend the meeting.'
App.HTMLBody = 'Hi Tim, <br><br>Kindly attend the meeting.'
App.Location = "Meeting Room 10"
App.Start = '2017-07-17 15:00'
App.Duration = 3
recipient='abcd@xyz.com'
App.MeetingStatus = 1
App.Recipients.Add(recipient)
App.Display()
#App.Send()
我也尝试过使用GetInspector.WordEditor,但这也只是提供纯文本。
Selection = App.GetInspector.WordEditor.Windows(1).Selection
Selection.TypeText ('Hi Tim, <br><br>Kindly attend the meeting.')
我该如何解决这个问题?有什么提示吗?
答案 0 :(得分:0)
This should be helpful:- Send an AppointmentIthem with python win32com library
Another way to do it:- http://www.baryudin.com/blog/sending-outlook-appointments-python.html