Rau*_*aul 7 delphi com outlook
我需要检索存储在本地磁盘上的outlooks的msg文件的主体并从每个文件中提取一些信息,它们的格式始终是相同的,只有数据更改,请指教.
在此先感谢劳尔
感谢大家,
由于限制回答我自己,我会在我的问题下面写下我的解决方案.
我检查了一些MS文档,这是我的解决方案按预期工作.
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;
Run Code Online (Sandbox Code Playgroud)