[Zope] zope win32com.client Outlook

Edward Muller edwardam@interlix.com
26 Jun 2003 10:17:52 -0500


I took a look at some OLD code that I used to access outlook/exchange..

It looks like I never actually uses Outlook.Application. Instead I used
cdo and used makepy.py to generate a cdo.py file. From there I followed
the Microsoft documentation at msdn IIRC.

On Thu, 2003-06-26 at 03:29, Deniz, Metin wrote:
> Hi everybody,
> 
> I have a problem with instantiating the Outlook application.
> Following is the listing of the external method I am using:
> ----------------------------------------------------------------------------
> ------
> import win32com.client
> import pythoncom
>   
> def sendEmail():
>     loadcomclient = 'false'
>     loadpycom = 'false'
> 
>     if win32com.client:
> 	loadcomclient = 'true'
>     if pythoncom:
> 	loadpycom = 'true'
> 
>     if((loadcomclient == 'false') or (loadpycom == 'false')):
> 	return 'Loaded win32com.client: ' + loadcomclient + '\r\n Loaded
> pythoncom: ' + loadpycom
>     #try:
>     pythoncom.CoInitialize()
> 
>     oOutlookApp =
> win32com.client.gencache.EnsureDispatch("Outlook.Application")
>     	
>     #oWordApp = win32com.client.gencache.EnsureDispatch("Word.Application")
> 	
>     return "Successfully loaded Outlook! \r\n" 
> 	
>     #except:
>     #return "MSOutlook: unable to load Outlook"
> ----------------------------------------------------------------------------
> ------
> This is the error message I receive:
> 
> Error Type: com_error
> Error Value: (-2146959355, 'Server execution failed', None, None)
> 
> If try to connect to "Word.Application" everything works fine.
> 
> If I execute this script outside of ZOPE then I get a connection to Outlook.
> 
> 
> Can anybody please tell me what I am missing?
> 
> 
> Thanks in advance.
> 
> 
> 
> Metin Deniz
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
-- 
Edward Muller

Interlix (http://www.interlix.com)
Phone: 417-862-0573 - Cell: 417-844-2435 - Fax: 417-862-0572

Web Hosting - PC Service & Support - Custom Programming - Network Service & Support
Specializing in Open Source Solutions