0

I have an outlook email which is a custom-form. It opens as a form when we double click on it. If we open it as a normal mail(single-click) it opens with some default body signature. I am able to read normal mails. I need the process of how to read the outlook custom-forms

I tried with the following code where it could read the forms.

import win32com.client
import win32com

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
accounts= win32com.client.Dispatch("Outlook.Application").Session.Accounts;
folders_object = outlook.Folders(accounts[0].DeliveryStore.DisplayName)
inbox = folders_object.Folders(2)
print inbox
messages = inbox.Items
message = messages.GetLast()
while message:
    print message.body
    message = messages.GetPrevious()

I am expecting to get the form data. But I am getting only a plain email. The form can be opened by double-clicking. Need some suggestion to read the outlook custom form through python.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
GopiKrishna
  • 109
  • 1
  • 6

1 Answers1

1

I am able to extract details from the custom form as:

message.UserProperties.Find('property_name')
GopiKrishna
  • 109
  • 1
  • 6