I need to get the body of msg outlooks files stored on the local disk and extract some information from each, their format is always the same, only data changes, please inform.
thanks in advance Raul
Thanks everyone
due to the restriction of answering myself, I will write my decision just below my question.
I checked some MS documentation, and now my solution works as expected.
procedure TForm1.displayOutlookMsg(aFileName: string); const olFormatHTML = 2; olFormatPlain = 1; olFormatRichText = 3 ; olFormatUnspecified = 0; var outlook: OleVariant; outlookMsg, bodyMsg: variant; begin try Outlook := GetActiveOleObject('Outlook.Application'); except Outlook := CreateOleObject('Outlook.Application'); end; outlookMsg:= outlook.CreateItemFromTemplate(aFileName); outlookMsg.bodyFormat := olFormatPlain; bodyMsg:= outlookMsg.body; Memo1.Lines.Add(VarToStr(bodyMsg)); outlook:= unassigned; end;
source share