Skip to Content
author's profile photo
Former Member

How to make a Carriage Return in a Word-Table by OLE Automation

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'.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Oct 07, 2005 at 10:32 AM

    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,

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 😉