[python-win32] Error trying to do a EmptyFolder() (MAPI)

Sriram ET. karra.etc at gmail.com
Sat Apr 14 07:19:29 CEST 2012


I have a folder in the Root Folder of a message store that I am trying to
clear using EmptyFolder(). The code is as follows:

                folder = store.OpenEntry(eid, None, MOD_FLAG)
                hr = folder.EmptyFolder(0, None, 0)

I get the error: ' Error: unsupported operand type(s) for &: 'NoneType' and
'int'

Changing the code to

                folder = store.OpenEntry(eid, None, MOD_FLAG)
                hr = folder.EmptyFolder(0, 0, 0)

I get the following exception: "Error: The Python instance can not be
converted to a COM object"

This is a command line tool, and I do not need the progress of the
operation. Can someone tell me what is the correct way to invoke
EmptyFolder()?

Thanks,
Sriram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120414/eb86cf99/attachment.html>


More information about the python-win32 mailing list