小弟想在自己的程序中,调用Outlook Express创建一封新邮件,并用程序把发件人、收件人、主题和正文内容自动加入到邮件中(注:正文内容为HTML,有图片),请问怎样可以做到呢?望各位大哥帮帮忙!

解决方案 »

  1.   

    This code activates the Tools|Send and Receive|All accounts menu item:uses Office_TLB; // Office97 for D5 users
    var
      ToolsMenu: CommandBar;
      SendRecMenuItem, AllAccs: CommandBarControl;
    begin
      ToolsMenu := (Outlook.ActiveExplorer.CommandBars as CommandBars).Item['Tools'];
      
      // D5 users can omit the underscore after 'Controls' in the next two lines
      SendRecMenuItem := ToolsMenu.Controls_['Send and Receive'];
      AllAccs := (SendRecMenuItem.Control as CommandBarPopup).Controls_['All Accounts'];
      AllAccs.Execute;If you're using Outlook 2000, you'll have to change 'Send and Receive', perhaps to 'Send/Receive'. (I've had one report that this works, one that it doesn't - perhaps there are spaces around the '/'? Any clarification of this would be very welcome! Pointless menu changes don't make automation any easier...) 
      

  2.   

    http://www.djpate.freeserve.co.uk/AutoOutl.htm#SendRecEmail
    參考這裹
      

  3.   

    SendMail:='mailto:'+'[email protected]'+'?subject=你好!';
    ShellExecute(0,Nil,PChar(SendMail),Nil,Nil,SW_SHOWNORMAL);