I cannot find out for the life of me, how to open Outlook.exe and create a message through pyrevit.
The python script I have runs just fine from Visual Studio, but when I push it through pyrevit, I get the following error:
“Import Error: no module named win32com.client”
Is there something I’m missing? Does IronPython require a specific library (other than win32com.client) to call Microsoft commands?
This is an example from the python script I wrote:
“”“Open an Outlook Message with the BIM Help Template”""
title = ‘Help\nRequest’
author = ‘Ron Rowcotsky’
import win32com.client as win32
def Emailer(text, subject, recipient):
outlook = win32.Dispatch(‘outlook.application’)
mail = outlook.CreateItem(0)
mail.To = recipient
mail.Subject = subject
mail.HtmlBody = text
MailSubject= “BIM Help”
MailInput=""" body “”"
Emailer(MailInput, MailSubject, MailAdress ) #that open a new outlook mail even outlook closed.
Any advice y’all might have would be greatly appreciated.