<br>i am trying to automate outlook using python. my code seems to work fine with outlook 2007, however with outlook 2003 it's giving the following error.<br><br>Traceback (most recent call last):<br> File "<stdin>",line 1, in <module><br>
File "C:\Python27\lib\site-packages\comtypes\client\_events.py", line 218 in ShowEvents<br>return comtypes.client.GetEvents(source, sink=EventDumper(), interface=interface)<br> File "C:\Python27\lib\site-packages\comtypes\client\_events.py", line 193,in GetEvents<br>
interface = FindOutgoingInterface(source)<br> File "C:\Python27\lib\site-packages\comtypes\client\_events.py", line 73 in FindOutgoingInterface<br> raise TypeError("cannot determine source interface")<br>
TypeError: cannot determine source interface<br><br>This is the code i am using<br><br>from comtypes.client import GetEvents<br>class EventSink(object):<br> def ApplicationEvents_11_NewMailEx(self, this, entryid):<br> print "mail arrived"<br>
print entryid<br> def ApplicationEvents_10_NewMailEx(self, this, entryid):<br> print "mail arrived"<br> print entryid<br> <br>from comtypes.client import CreateObject<br>xl = CreateObject("Outlook.Application")<br>
from comtypes.client import PumpEvents<br>sink = EventSink()<br>connection = GetEvents(xl, sink)<br>PumpEvents(3000)<br><br>can anyone plz point out as to what could be possibly wrong. <br>Thanks in advance <br>