hi there
i have been tasked with automating a simple create email task using microsoft outlook.
the code below works create unfortunately it works only at a system level i.e. the user does not see it.
please help me make it visible
[CODE=PYTHON]
text="hello wolrd \nhello world this is hopefully a new paragrpah"
subject="this is the E-mail"
recipient="thin gy-ma-bob@hotmail.com "
o = win32com.client .DispatchEx("Ou tlook.Applicati on.11")
#o.Show() #<--here
Msg = o.CreateItem(0)
Msg.To = recipient
Msg.Subject = subject
Msg.Body = text
Msg.Save()
Msg.close
o.Quit()
[/CODE]
I have tried
o.Visible throws a com error (AttributeError : Outlook.Applica tion.Visible)
o.Display throws a com error (AttributeError : Outlook.Applica tion.Display)
both the above set to true gain throws a com error
o.Show (AttributeError : Outlook.Applica tion.Show)
all of the above with and without attributes
If i set o.Visible =1 (i.e. True)I get the com error
AttributeError: Property 'Outlook.Applic ation.Visible' can not be set.
it must be possible as all other office products you can set to be visible.
obviusly I can
or run outlook.exe
but that is just nasty....
I might as well be using a Key pressing program and not bother with com
Please help
cheers
D2
i have been tasked with automating a simple create email task using microsoft outlook.
the code below works create unfortunately it works only at a system level i.e. the user does not see it.
please help me make it visible
[CODE=PYTHON]
text="hello wolrd \nhello world this is hopefully a new paragrpah"
subject="this is the E-mail"
recipient="thin gy-ma-bob@hotmail.com "
o = win32com.client .DispatchEx("Ou tlook.Applicati on.11")
#o.Show() #<--here
Msg = o.CreateItem(0)
Msg.To = recipient
Msg.Subject = subject
Msg.Body = text
Msg.Save()
Msg.close
o.Quit()
[/CODE]
I have tried
o.Visible throws a com error (AttributeError : Outlook.Applica tion.Visible)
o.Display throws a com error (AttributeError : Outlook.Applica tion.Display)
both the above set to true gain throws a com error
o.Show (AttributeError : Outlook.Applica tion.Show)
all of the above with and without attributes
If i set o.Visible =1 (i.e. True)I get the com error
AttributeError: Property 'Outlook.Applic ation.Visible' can not be set.
it must be possible as all other office products you can set to be visible.
obviusly I can
Code:
os.system("start outlook")
but that is just nasty....
I might as well be using a Key pressing program and not bother with com
Please help
cheers
D2
Comment