Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Is there a function to open the outlook mail and to attach certain..

Former Member
0 Kudos


Is there a function to open the outlook mail and to attach certain selected files?


Former Member
0 Kudos

here is a code snippet from one of our programs

  data: out type ole2_object,
        outmail type ole2_object,
        att type ole2_object,
        atts type ole2_object.

      create object out 'Outlook.Application'.
      call method of out 'CREATEITEM' = outmail
          #1 = 0.
      set property of outmail 'SUBJECT' = 'Smartform Output from SAP'.
      call method of outmail 'ATTACHMENTS' = atts.
      call method of atts 'ADD'
          #1 = p_file.
      call method of outmail 'DISPLAY'.

in our case, we save the data to a local file with the path p_file.

so, we create the attachment on a local drive, at path p_file

we open outlook

we create a mail item

we set the subject

we add the attachment

and we call disply, to pop the email up for any changes the user wants to make.

in other programs we also use

  set property of outmail 'TO' = alvline-prc_email.

to set the TO address of the email

hope this helps