【问题标题】:Outlook msg files stored in local disk, how to read with delphiOutlook msg文件存储在本地磁盘,如何用delphi读取
【发布时间】:2011-09-07 02:54:30
【问题描述】:

我需要检索存储在本地磁盘上的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;

【问题讨论】:

  • 非常好的一个简单的解决方案+1,您可以发布代码答案并接受它。
  • 您应该将此作为答案,然后接受该答案。这将减少您未接受的答案数量并提高整体 StackOverflow 质量:stackoverflow.com/…

标签: delphi com outlook


【解决方案1】:

Raul,您可以检查 Outlook MSG file format 或使用 Delphi 组件(如 SMMsg suite)自己解析 msg 文件。

【讨论】:

    【解决方案2】:

    你可以试试 Scalabium 的 SMMsg

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-08
      • 2023-03-13
      • 1970-01-01
      • 2014-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多