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: 

How to attache a word document file

Former Member
0 Kudos

Hi all,

Thanks in advance,

Does anyone know please help me out.

I want to attach word document file into one of the field in my customised screen, and when i double click the path it has to open that particular file in a small window .

Please provide me sample of code, I think that can be done throu oop .

Thanks and reagards

Shiva prasad D

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Use the following code to execute the native application to open your document. Example, if user click on a word document, this will open the document in Microsoft Word. If execl, will open the document in Microsoft Excel.



  CALL METHOD CL_GUI_FRONTEND_SERVICES->EXECUTE
    EXPORTING
      DOCUMENT               = 'C:test.doc'
      MAXIMIZED              = 'X'
      SYNCHRONOUS            = 'X'
    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
      OTHERS                 = 8.

Regards,

Rich Heilman