【发布时间】:2019-09-13 03:26:06
【问题描述】:
我想在通过 win32com 创建的任务正文中创建一个超链接。
这是我目前的代码:
outlook = win32com.client.Dispatch("Outlook.Application")
outlook_task_item = 3
recipient = "my_email@site.com"
task = outlook.CreateItem(outlook_task_item)
task.Subject = "hello world"
task.Body = "please update the file here"
task.DueDate = dt.datetime.today()
task.ReminderTime = dt.datetime.today()
task.ReminderSet = True
task.Save()
我尝试设置属性task.HTMLBody,但出现错误:
AttributeError: Property 'CreateItem.HTMLBody' can not be set.
我也试过了
task.Body = "Here is the <a href='http://www.python.org'>link</a> I need"
但我没有得到正确的超链接。
但是,如果我在 Outlook 中创建任务前端,我可以添加超链接。
【问题讨论】: