1

I'm trying to create an Appointment in Outlook 2007, with Python 3. I am able to create a calendar with plain text body, but not a body with HTML text. There is no 'CreateItem.HTMLBody' property

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()

I have also tried using GetInspector.WordEditor, but that too just gives plain text.

Selection = App.GetInspector.WordEditor.Windows(1).Selection
Selection.TypeText ('Hi Tim, <br><br>Kindly attend the meeting.')

How can I go about this? Any tips?

Ivan Kolesnikov
  • 1,787
  • 1
  • 29
  • 45
Harsh Goyal
  • 154
  • 1
  • 2
  • 11

1 Answers1

-1

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

Abhijeetk431
  • 847
  • 1
  • 8
  • 18