Outlook message files stored on local disk, how to read using delphi

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; 
+6
source share
2 answers

Raul, you can analyze msg files yourself by checking Outlook MSG file format or using a Delphi component, for example SMMsg suite .

+2
source

You can try SMMsg from Scalabium.

+2
source

Source: https://habr.com/ru/post/889628/


All Articles