11-08-2012 3:22 PM
in the new sap gui the integration with word en excel is working fine (which is checked in tcode OLE)
but with outlook the ole integration doesn't work anymore ?
I use the code below for testing which works fine with sap gui 7.20 patchlevel 7
anybody got a clue what changed in the gui family regaring ole integration ?
REPORT ZTEMP_OUTLOOK.
INCLUDE : OLE2INCL.
DATA: OUT TYPE OLE2_OBJECT,
OUTMAIL TYPE OLE2_OBJECT,
DESTI TYPE OLE2_OBJECT,
ATT TYPE OLE2_OBJECT,
ATTS TYPE OLE2_OBJECT.
CREATE OBJECT OUT 'Outlook.Application'.
CALL METHOD OF OUT 'CREATEITEM' = OUTMAIL EXPORTING #1 = 0.
SET PROPERTY OF OUTMAIL 'SUBJECT' = 'Subject of your email'.
SET PROPERTY OF OUTMAIL 'BODY' = 'Body of your email'.
CALL METHOD OF OUTMAIL 'RECIPIENTS' = DESTI.
CALL METHOD OF DESTI'ADD' EXPORTING #1 = 'xxx @ yyy.com'.
CALL METHOD OF OUTMAIL 'ATTACHMENTS' = ATTS.
CALL METHOD OF ATTS 'ADD' EXPORTING #1 = 'C:\TEMP\bijlage.pdf'.
CALL METHOD OF OUTMAIL 'DISPLAY'.
kind regards
arthur
11-08-2012 3:43 PM
oh and I get subrc = 2 after CALL METHOD OF OUTMAIL 'DISPLAY'. but I can't find what subrc 2 means in this case.
01-17-2013 4:35 PM
Hi Arthur,
I am facing the same problem. Outlook.Application is not working. Excel.Application works fine.
Did you find any solution for this?
Regards
Manuel
01-17-2013 7:30 PM
Hello,
Are you using outlook 2010?
Calendar Cynchronisation for Outlook does not work for Office 2010
Refer to the Gui installation guide page 53
01-18-2013 8:31 AM
Hello,
thanks for your hint.
Yes I am using Outlook 2010. The strange thing is that word and excel work fine.
Regards
01-18-2013 4:42 PM
Hello Arthur,
Microsoft Outlook is not supported with Office integration - see note
http://service.sap.com/sap/support/notes/722513
Please also ensure that you are using only 32bit Office.
http://service.sap.com/sap/support/notes/1442028
Best Regards,
Jude
01-22-2013 10:43 AM
Thanks for your support.
I used office 2010 64bit. I removed it and installed the 32bit-version. Now everything works fine. Even outlook integration.
Regards Manuel
01-31-2013 10:17 AM
I have solved the problem by calling outlook with parameters instead of using OLE
concatenate '/m "mailto:' h_email
'?bcc=' ls_mailsettings-zzccemail
'&subject=' lv_mailtitel
'&body=' v_char
'"/a "' gv_file '"' into lv_parameter.
cl_gui_frontend_services=>execute(
EXPORTING
* document =
application = 'Outlook'
* parameter = '/m someone@gmail.com /a "H:\export.xls"'
parameter = lv_parameter
* default_directory =
* maximized =
* minimized =
* synchronous =
* operation = 'OPEN'
* EXCEPTIONS
* cntl_error = 1
* error_no_gui = 2
* bad_parameter = 3
* file_not_found = 4
* path_not_found = 5
* file_extension_unknown = 6
* error_execute_failed = 7
* synchronous_failed = 8
* not_supported_by_gui = 9
* others = 10
).
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.