Code By GeNiUS !
genius_user@yahoo.com
{Here is an example without using the imported type library that shows a new
message window:}
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;