[python-win32] Operational errorr :

Antony Joseph antonyjoseph89 at gmail.com
Fri Dec 21 10:12:39 CET 2007


I am getting Operational Error : when i try get my contacts .

My code :
import win32com.client
oOutlook = win32com.client.gencache.EnsureDispatch("Outlook.Application")
onMAPI = oOutlook.GetNamespace("MAPI")
ofContacts = onMAPI.GetDefaultFolder(10) # 10=outlook contacts folder
redemption = oOutlook.CreateObject('Redemption.SafeContactItem')
for i in range(len(ofContacts.Items)):
    redemption.Item = ofContacts.Items.Item(i+1)
    print redemption.Subject

can any one tell me , what i am doing error or please tell me to solve this
problem.


My Error:

  File "m1.py", line 5, in <module>
    redemption = oOutlook.CreateObject('Redemption.SafeContactItem')
  File
"C:\Python25\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-00
0000000046x0x9x3\_Application.py", line 82, in CreateObject
    ret = self._oleobj_.InvokeTypes(277, LCID, 1, (9, 0), ((8,
1),),ObjectName
pywintypes.com_error: (-2147352567, 'Exception occurred.', (4096, 'Microsoft
Off
ice Outlook', 'The operation failed.', None, 0, -2147221005), None)


Antony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20071221/c9e399c0/attachment.htm 


More information about the python-win32 mailing list