[Zope] zope win32com.client Outlook

Deniz, Metin Metin.Deniz@commerzbankib.com
Thu, 26 Jun 2003 10:29:15 +0200


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