getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail (/thread-5180.html) |
getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail - jainpratik163 - Sep-21-2017 i am trying to read outlook mail and getting below error while running the code and below is my code which i am running.import win32com.client outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case, # the inbox. You can change that number to reference # any other folder messages = inbox.Items message = messages.GetLast() body_content = message.body print (body_content)and i am using Quote:python 3.5.2 RE: getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail - buran - Sep-21-2017 It is Body , not body
RE: getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail - jainpratik163 - Sep-21-2017 thanks it is working now.. but i have one doubt previously that code with Quote:bodywas working. RE: getting AttributeError: '<win32com.gen_py.Microsoft Outlook 16.0 Object Library._Mail - buran - Sep-21-2017 Given the CamelCase naming convention used in win32com I doubt it ever worked:-) |