Code: Alles auswählen.
REPORT z_word_textmarke.
TABLES: sscrfields.
*
* OLE-Definitionen der SAP
INCLUDE ole2incl.
INCLUDE excel__c.
*
DATA: h_word TYPE ole2_object.
*
PARAMETERS: p_dotfl LIKE rlgrap-filename OBLIGATORY. "Formatvorlage
*-----------------------------------------------------------------------
START-OF-SELECTION.
*
CREATE OBJECT h_word 'word.basic'.
CALL METHOD OF
h_word
'AppShow'.
* Dokument auf Basis der Vorlage erstellen
CALL METHOD OF h_word 'FileNew'
EXPORTING
#1 = p_dotfl.
* Textmarke anspringen
PERFORM goto_textmark USING 'TM1'.
CALL METHOD OF h_word 'Insert'
EXPORTING
#1 = 'Text1'.
* Textmarke anspringen
PERFORM goto_textmark USING 'TM2'.
CALL METHOD OF h_word 'Insert'
EXPORTING
#1 = 'DUMMY'.
END-OF-SELECTION.
************************************************************************
*---------------------------------------------------------------------
* Form GOTO_TEXTMARK
*---------------------------------------------------------------------
FORM goto_textmark USING p_tmark.
DATA: txtmark(255) TYPE c.
*
txtmark = p_tmark.
CALL METHOD OF
h_word
'EditGoto'
EXPORTING
#1 = txtmark.
ENDFORM. " GOTO_TEXTMARK