I'm trying to understand outlook interaction through win32com better. I've been unable to find clear documentation that allows me to utilise win32com to read emails effectively, from my current investigation it seems like a fairly regular sentiment by users. Thus comes the following information and request:
Could someone;
1. Give a link to the location of clear documentation (if it exists)
2. Expand on the below
Below is the current functionality I've found based on reading other peoples code.
Take the below code:
import win32com outlook=win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") inbox=outlook.GetDefaultFolder(6) messages=inbox.Items for message in messages: attachments = message.attachments for attachment in attachments: pass
The objects used above have the following functionality that I'm aware of:
inbox -
.Folders .Items
messages -
.GetFirst() .GetLast() .GetNext() .GetPrevious() .Attachments
message -
.Subject .Body .To .Recipients .Sender .Sender.Address
attachments -
.item() .Count
attachment -
.filename
If you know of any more functionality then please add to this in your answers.
Learn how you can use IMAP protocol to extract, parse and read emails from outlook, aol, office 365 and other email providers as well as downloading attachments using imaplib module in Python.
Run ' win32com\client\makepy.py ' (eg, run it from the command window, or double-click on it) and a list will be presented. Select the Type Library ' Microsoft Word 8.0 Object Library ' From a command prompt, run the command ' makepy.py "Microsoft Word 8.0 Object Library" ' (include the double quotes).
win32com.server packageSupport for COM servers written in Python. The modules in this package provide most of the underlying framework for magically turning Python classes into COM servers, exposing the correct public methods, registering your server in the registry, etc.
The visual basic for applications reference is your friend here. Try starting with this link...
Interop Outlook Mailitem Properties
For instance I can see that message will probably have additional properties than what you listed above. For example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With