Deane Hafling wrote in message
news:7kdna0$
rs83@forums.borland.com…
> How can I call up the Outlook New E-mail Form???
>
> I am looking at the outlook_tlb.pas right now and can’t figure out how to
> call it up. Any suggestions???
>
>
> Deane Hafling
>
>
Here is an example without using the imported type library that shows a new
message window:
[code lang=”delphi”]const // Create Outlook Enumerated constants
olImportanceLow = 0;
olImportanceNormal = 1;
olImportanceHigh = 2;
olOutlookAppCLSID = ‘Outlook.Application’;
olMailItem = 0;
olOriginator = 0;
olTo = 1;
olCC = 2;
olBCC = 3;
olAttachment = 255;
var
i : Integer;
objOutlook, // Outlook.Application
objOutlookMsg: variant; // Outlook.MailItem
begin
// Create the Outlook session.
try
objOutlook := CreateOleObject(olOutlookAppCLSID);
except
MessageDlg(‘Could not open Microsoft Outlook. ‘ +
‘Please make sure it is installed correctly on your
workstation.’ +
#10#10 + ‘Message cannot be sent at this time.’,
mtError, [mbOK], 0);
Exit;
end;
try
// Create the message.
objOutlookMsg := objOutlook.CreateItem(olMailItem);
objOutlookMsg.Display // Show Outlook Message Window
finally
objOutlookMsg := Unassigned; // Destroy objects
objOutlook := Unassigned;
end;
end;
[/code]
[tags]Delphi, EMail[/tags]
0 Kommentare zu “Open Outlook EMail Form (2)”