Highlighted
Absent Member.
Absent Member.
593 views

[archive] Email attachment in MS Outlook

[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.
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Email attachment in MS Outlook

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.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Email attachment in MS Outlook

Thanks for you help.
Patty
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Email attachment in MS Outlook

Thank you for the contribution to the forum!

Gisle
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.