开发者

Delphi and MSG file

开发者 https://www.devze.com 2023-03-05 05:21 出处:网络
How do I display an Outlook message file using Delphi 2010? Is there a way to wra开发者_StackOverflow中文版p an Outlook app and open it within Delphi?Use something like the following:

How do I display an Outlook message file using Delphi 2010? Is there a way to wra开发者_StackOverflow中文版p an Outlook app and open it within Delphi?


Use something like the following:

var App : OutlookApplication;
    NS : _Namespace;
    Msg : _MailItem;
begin
  App := CreateOleObject('Outlook.Application');
  NS := App.GetNamespace('MAPI');
  NS.Logon;
  Msg := NS.OpenSharedItem('c:\temp\test.msg');
  ShowMessage(Msg.Subject);

You can also use Redemption (I am its author) and its RDOSession.GetMessageFromMsgFile method.


TOutlookApplication ? It exists in D2007 and in Delphi XE. I assume it exists in D2010 too.

As an alternative you can import the Outlook Object Library through the Component->Import component... menu option.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号