Python script unable to connect to the Microsoft Outlook Version 1.2023.1020.100 (Production) with co pilot.
I have this piece of example code below to create email template using python. It work in the old outlook version but throw an error (image below) with the new outlook version. If anyone has encountered a similar issue or knows of a solution :)
import win32com.client
from win32com.client import Dispatch, constants
const=win32com.client.constants
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "Subject Subject!!"
newMail.BodyFormat = 2 # olFormatHTML
newMail.HTMLBody = "<HTML><BODY>Enter the <span style='color:red'>message</span> text here.</BODY></HTML>"
newMail.To = "******@test.com"
newMail.display()