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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: Create Outlook 2010 Mail with ABAP (Outlook 2003 worked)

Former Member
0 Kudos

Hi experts,

2 years ago, i wrote an ABAP program, which created outlook mails and sent them to a special mail address.

Last week in our company we upgraded from Windows XP to Windows 7. Furthermore we replaced Outlook 2003 with Outlook 2010.

Since then there is a problem with my E-Mail program. Does anyone have some information what the problem might be?

That's the slice of code, which should be interessting (methtext is 'DISPLAY'):


FORM f_sendmail USING  value(gv_mail_toaddr)
                       value(gv_mail_ccaddr)
                       value(gv_mail_subject)
                       value(gv_mail_body)
                       value(methtext).
  INCLUDE ole2incl.
  DATA: lr_outlook TYPE ole2_object,
  lr_mi TYPE ole2_object.

  CREATE OBJECT lr_outlook 'Outlook.Application'.

  CALL METHOD OF lr_outlook 'CreateItem' = lr_mi
    EXPORTING #1 = 0.

  SET PROPERTY OF lr_mi 'To' = gv_mail_toaddr.
  SET PROPERTY OF lr_mi 'CC' = gv_mail_ccaddr.
  SET PROPERTY OF lr_mi 'Subject' = gv_mail_subject.
  SET PROPERTY OF lr_mi 'Body' = gv_mail_body.

  CALL METHOD OF lr_mi methtext.

  FREE OBJECT lr_outlook.
ENDFORM. "F_SENDMAIL

Thanks for your help!

Best regards,

Patrick

1 REPLY 1

Former Member
0 Kudos

Hi,

Check if you can get any useful information regarding your issue from the SAP Note - "1570573 - Rich Client throws email error on Windows 7 with Outlook 2007 and Outlook 2010 ".

Regards,

Harish