Page 1 of 1

Outlook COM selected email  Topic is solved

Posted: 23 Jan 2019, 03:32
by euras
Hi, how to read the email, I have selected, but not doubleclicked to open it on the new window? The following code read the email, which I open in a separate window, but how to read the one, I have selected in inbox and which appeared on the right side of application (uploads the email body)?

Code: Select all

ol := ComObjActive("Outlook.Application").ActiveInspector.CurrentItem
MsgBox, % ol.Body

Code: Select all

ol := ComObjActive("Outlook.Application").ActiveExplorer.Selection.Item(1)
MsgBox % "Sender: " ol.ReceivedByName "`r`nReceived Time:`r`n" ol.ReceivedTime "`r`nSubject:`r`n" ol.Subject "`r`nBody:`r`n" ol.Body