win32con.client.constants error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Barry Newberger

    #1

    win32con.client.constants error

    I am working on a Outlook COM project. For some reason
    win32com.client .constants

    quit working between runs of one of my test scripts. It's supposed to
    acquire attributes for all constants defined in loaded COM servers
    through its __dicts__ attribute,and did for awhile

    Now it is throwing an AttributeError:



    PythonWin 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
    on win32.

    Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin'
    for further copyright information.

    Traceback (most recent call last):

    File
    "C:\Python24\Li b\site-packages\python win\pywin\frame work\scriptutil s.py",
    line 310, in RunScript

    exec codeObject in __main__.__dict __

    File "C:\Documen ts and
    Settings\bnewbe rg\Desktop\mail _script\mail_mo ve_init_test.py ", line 22,
    in ?

    msgFolderTypeCo nsts = {'Rcvd': constants.olFol derInbox, 'Sent':
    constants.olFol derSentMail}

    File "C:\Python24\Li b\site-packages\win32c om\client\__ini t__.py", line
    168, in __getattr__

    raise AttributeError, a

    AttributeError: olFolderInbox



    Code snippet:
    from win32com.client import gencache, constan

    [SNIP]

    class MSOutlook(objec t):

    def __init__(self):

    try:

    self.oOutlookAp p =
    gencache.Ensure Dispatch("Outlo ok.Application" )

    self.outlookFou nd = True

    except:

    print "MSOutlook: unable to load Outlook"

    self.outlookFou nd = False

    if not self.outlookFou nd: return

    [SNIP]

    # Outlook default folder constants

    msgFolderTypeCo nsts = {'Rcvd': constants.olFol derInbox, 'Sent':
    constants.olFol derSentMail}

    folderSet = [yr, mo, msgType] # Used to loop over folder tree.



    I am running Python 2.4.4 and pywin32-210. I tried reinstalling pywin
    without success.

    Thanks,

    Barry Newberger
Working...