Welcome to Dream.In.Code
Become an Expert!

Join 149,516 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,364 people online right now. Registration is fast and FREE... Join Now!




OutLook and Delphi

 
Reply to this topicStart new topic

OutLook and Delphi

Liezel
27 Jun, 2007 - 05:36 AM
Post #1

New D.I.C Head
*

Joined: 25 Apr, 2007
Posts: 9


My Contributions
Hi I am trying to send an email with a file attached using Delphi.
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.

Here is my code:

var
filename : string;
OutLook : OleVariant;
MI : Variant;

//Get filename code here

MI := Outlook.CreateItem(olMailItem);
MI.Attachments.Add(filename, EmptyParam, EmptyParam, EmptyParam); //????? Help here
User is offlineProfile CardPM
+Quote Post

Liezel
RE: OutLook And Delphi
27 Jun, 2007 - 11:55 PM
Post #2

New D.I.C Head
*

Joined: 25 Apr, 2007
Posts: 9


My Contributions
Finally got it.

MI.Attachments.Add(filename);

Delphi 5 and Delphi 7 differ quite a bit. Why don't stuff like this stay standard?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:08PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month