Outlook/Exchange CDO/COM questions

Mark Hammond mhammond at skippinet.com.au
Thu Jan 16 20:17:21 EST 2003


John Taylor wrote:
> Mark Hammond <mhammond at skippinet.com.au> wrote in message news:<BSlV9.16324$UB4.73555 at news-server.bigpond.net.au>...
> 
>>John Taylor wrote:
>>
>>>I have 3 questions about the code that I am writing (posted below).
>>>
>>>1) This code works on Inbox, but I really need it to work on the "Sent
>>>Items" folder, but can not figure this out.
>>
>>folder = outlook.Session.GetDefaultFolder(constants.olFolderSentMail)
>>
>>should open it for you.
>>
> 
> 
> C:\code\outlook>python outlook.py
> Traceback (most recent call last):
>   File "outlook.py", line 70, in ?
>   File "outlook.py", line 65, in main
>   File "outlook.py", line 21, in msg_info
> NameError: global name 'outlook' is not defined

Add this to the top:

from win32com.client import gencache, constants
outlook = gencache.EnsureDispatch("Outlook.Application")

Mark.





More information about the Python-list mailing list