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: 

Regarding WInWord Integration

Former Member
0 Kudos
69

Hello Everyone,

I am new to WWI, Anyone can send me any study material with examples.

My Email ID - sukesh.ku@gmail.com

Help will be highly appreciated.

Regards,

Sukesh.

1 REPLY 1

former_member189059
Active Contributor
0 Kudos
48

Hello,

I'm not sure what you are looking for

but this is an example of OLE word

*&---------------------------------------------------------------------*
*& Report  ZKRIS_OLE6_WORD
*&
*&---------------------------------------------------------------------*
*&
*& Made by KRiS DoNAlD
*&---------------------------------------------------------------------*

report  zkris_ole6_word.
  type-pools ole2 .

  data: application      type ole2_object.
  data: word             type ole2_object.
  data: documents        type ole2_object.
  data: newdoc           type ole2_object.
  data: actdoc           type ole2_object.
  data: selection        type ole2_object.
  data: shapes           type ole2_object.
  data: tbox             type ole2_object.
  data: tbox_sel         type ole2_object.

  data: tb_sel           type ole2_object.


*---------------------------------------------------------------------*
*                        Start of writing to Word                     *
*---------------------------------------------------------------------*

  create object word 'WORD.APPLICATION' .
  if sy-subrc ne 0 .
    message s000(su) with 'Error while creating OLE object!'.
    leave program .
  endif .


  get property of word 'documents' = documents.
  call method of documents 'Add' = newdoc.

  call method of newdoc 'Activate'.


*--Getting active document handle
  get property of word 'activedocument' = actdoc .

*--Getting applications handle

  get property of word 'Selection' = selection.


*--setting object's visibility property
  set property of word 'visible' = '1' .

  call method of selection 'TypeText'
    exporting
    #1 = 'blahh'.

  get property of actdoc 'Shapes' = shapes .

  call method of shapes 'AddTextbox' = tbox
  exporting
    #1 = 1
    #2 = '99'
    #3 = '90'
    #4 = '207'
    #5 = '153'.

  get property of tbox 'Select' = tb_sel.
   call method of selection 'TypeText'
    exporting
    #1 = 'inboxx'.