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='[email protected]'

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?

1 Answer 1

-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

Sign up to request clarification or add additional context in comments.

2 Comments

I have gone through them before, it doesn't address how to send an html body. That's where I'm stuck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.