How may I split a table row at the position of the caret?

From this having the caret part-down the left cell:

image

(note that the vertical position of the text at the caret and corresponding in the right cell is dependent on text wrap) I want this:

image

in one (or few) operations - without having to manually cut and paste text between cells.

Is this possible?

This workaround seems to me a bit easier than to cut and paste between cells.

  1. Convert table to text separating text at paragraphs (you will get the second column content below).
  2. Convert text to table separating text at paragraphs (you will get one column with one paragraph per cell).
  3. Insert a column after (to the right).
  4. [Move] Copy last cells content to second column.
  5. Merge cells as needed [one column at a time].
  6. [Delete empty rows.]

Thanks, but that will fails on:

image

having a para break.

No. You must just…

(Thanks for the updated pic.)

Ah I see. But to cover:

image

I would have to have an amazing memory over hundreds of rows.

Make a copy of the document, and put both windows side by side.
Or, add empty paragraphs before step 1.

unfortunately nothing out of the box,
and Recording a Macro is not that good at spliting cells,

so, it would require a bit of not so trivial programming – that AI will probably be able to deliver in a few months or years :wink:

Thanks, and thanks for saving my time attempting a macro.

This can be fixed.
The following macro splits a text table cell into two horizontally according to the position of the visible cursor.

Sub SplitCellByCarePos()
  Dim oDoc As Object, oDisp As Object, oFrame As Object, cmd As String
  Dim oCell As Object, oViewCursor As Object, oTableCursor As Object
  Dim args(1) as new com.sun.star.beans.PropertyValue, oPropst
   
  oDoc = ThisComponent
  
  oDisp = createUnoService("com.sun.star.frame.DispatchHelper")
  oFrame = oDoc.CurrentController.Frame
  oViewCursor = oDoc.CurrentController.ViewCursor
  On Error GoTo ErrLabel
  oCell = oViewCursor.Cell
  On Error GoTo 0
  If oCell Is Nothing Then Exit Sub
 
  For Each cmd In Array("EndOfDocumentSel", "Copy", "Delete", "GoDown", "Paste")
    If cmd = "GoDown" Then
      oTableCursor = oViewCursor.TextTable.createCursorByCellName(oCell.CellName)
      oTableCursor.splitRange(1, True) 
    
      args(0).Name = "Count"  : args(0).Value = 1
      args(1).Name = "Select" : args(1).Value = False
      oProps = args    
    
    Else   
       oProps = Array()
    End If
   
    oDisp.executeDispatch oFrame, ".uno:" & cmd, "", 0, oProps
  Next cmd
  
ErrLabel: 
End Sub
2 Likes

elegant :+1:


image

would be cool to identify the position in the second column aligned with the initial cursor to reapply the split there :wink:

1 Like

Here’s a solution that works in MS Word 2003 so perhaps in LOW, albeit not swift nor good where para marks are present:

Not yet tested in LOW.