'Load outlook email template (.oft) via win32com
I like to load an outlook email template (.oft) via win32com for automation. I like to do something along this lines:
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
#mail.Open() does not exist... but what instead?
mail.Open('Template1.oft')
mail.HtmlBody = alterEmail(mail.HtmlBody)
mail.Display(True)
mail.Save()
Solution 1:[1]
Use Application.CreateItemFromTemplate
instead of Application.CreateItem
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dmitry Streblechenko |