How to add an embedded image to an HTML message in Outlook 2010

Found the answer here. The key bits being: Const PR_ATTACH_MIME_TAG = “http://schemas.microsoft.com/mapi/proptag/0x370E001E” Const PR_ATTACH_CONTENT_ID = “http://schemas.microsoft.com/mapi/proptag/0x3712001E” Const PR_ATTACHMENT_HIDDEN = “http://schemas.microsoft.com/mapi/proptag/0x7FFE000B” … Set colAttach = l_Msg.Attachments For x = 1 To Items.Count Set l_Attach = colAttach.Add(Items.Item(x)) Set oPA = l_Attach.PropertyAccessor oPA.SetProperty PR_ATTACH_MIME_TAG, ItemTypes.Item(x) oPA.SetProperty PR_ATTACH_CONTENT_ID, “item” & x oPA.SetProperty PR_ATTACHMENT_HIDDEN, True Next

Reading e-mails from Outlook with Python through MAPI

I had the same problem you did – didn’t find much that worked. The following code, however, works like a charm. 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 … Read more