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 make a Carriage Return in a Word-Table by OLE Automation

Former Member
0 Kudos

I generated a Table in a Word-Document by using the OLE2 Interface.

After that I wrote a Text in the first cell of the table.

Now I want to make a Carriage Return to write another Textline in the same Cell.

But first i must move the cursor to the end of the Text.

I haven't already figured that out.

Can someone Help me?

I tried this but then the Cursor moves to the Begin of the second Cell in the same row.


*Writing the Text in the Cell
  GET PROPERTY OF o_cell 'Range' = o_range.
  SET PROPERTY OF o_range 'Text' = wa_anschr-ename.

*Move Cursor
  GET PROPERTY OF o_cell  'Range' = o_range.
  GET PROPERTY OF o_range 'End' = ld_pos.
  SET PROPERTY OF o_range 'Start' = ld_pos.
  CALL METHOD OF o_range ' Select'.

2 REPLIES 2

guillaume-hrc
Active Contributor
0 Kudos

Isn't it possible to put the Carriage Return (as far as I can rember it should be a ALT+ENTER) it the wa_anschr-ename ?

Cheers,

0 Kudos

I don't know about your suggestion.

I solved the Problem with that Method:


 CALL METHOD OF o_selection 'EndKey'
    EXPORTING
      #1 = '5'.

  CALL METHOD OF o_selection 'TypeParagraph'.

The Parameter "5" ist the VB Constant wdline...

Now it works and I'm happy