OutLook and Delphi

liunx

Guest
Hi I am trying to send an email with a file attached using Delphi.<br />The following code worked in Delphi 5, it compiles in Delphi 7, but OutLook doesn't reconize the string as a string. filename is a string, I have checked and displayed it in a MessageDlg and it works fine there and if I just use a string instead of filename, OutLook is happy.<br /><br />Here is my code:<br /><br />var<br />filename : string;<br />OutLook : OleVariant;<br />MI : Variant;<br /><br />//Get filename code here<br /><br />MI := Outlook.CreateItem(olMailItem);<br />MI.Attachments.Add(filename, EmptyParam, EmptyParam, EmptyParam); //????? Help here
</div>
 
Top