Skip to main content

[Migrated content. Thread originally posted on 27 July 2005]

Anyone know the code to attach a file to the email message using MS Outlook.

Sending email is working with the text in the body.

Want to attach an ascii file which is a report to the message.

[Migrated content. Thread originally posted on 27 July 2005]

Anyone know the code to attach a file to the email message using MS Outlook.

Sending email is working with the text in the body.

Want to attach an ascii file which is a report to the message.
Assuming you already have your Outlook object up and running, this should do the trick:


77 myAttachments HANDLE OF Attachments
..

INQUIRE myMailItem Attachments IN myAttachments.
MODIFY myAttachments @Add(
  "c:\\mydir\\myfile.txt", olByValue, 1, "Here is your file").


Note that the number 1 in the Add parameter list is an index, if you add additional files, you should increment this one.

As a courtesy to others, if it works I would appreciate if you could post a complete example here in the forum.

[Migrated content. Thread originally posted on 27 July 2005]

Anyone know the code to attach a file to the email message using MS Outlook.

Sending email is working with the text in the body.

Want to attach an ascii file which is a report to the message.
Thanks for you help.
Patty

[Migrated content. Thread originally posted on 27 July 2005]

Anyone know the code to attach a file to the email message using MS Outlook.

Sending email is working with the text in the body.

Want to attach an ascii file which is a report to the message.
Thank you for the contribution to the forum!

Gisle