G
Greg Maxey
Stephan,
Actually it needs a qualifier to keep from tripping up on a break found
outside a table:
Sub ScratchMacro()
Dim i As Long
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = Chr(12)
While .Execute
oRng.Select
If oRng.Information(wdWithInTable) Then
oRng.MoveEnd wdCharacter, 1
oRng.Collapse wdCollapseStart
With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.SplitTable
.MoveLeft Unit:=wdCharacter, Count:=1
.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
.Delete Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
Else
oRng.Delete
oRng.Collapse Direction:=wdCollapseEnd
End If
Wend
End With
End Sub
Actually it needs a qualifier to keep from tripping up on a break found
outside a table:
Sub ScratchMacro()
Dim i As Long
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = Chr(12)
While .Execute
oRng.Select
If oRng.Information(wdWithInTable) Then
oRng.MoveEnd wdCharacter, 1
oRng.Collapse wdCollapseStart
With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.SplitTable
.MoveLeft Unit:=wdCharacter, Count:=1
.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
.Delete Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
Else
oRng.Delete
oRng.Collapse Direction:=wdCollapseEnd
End If
Wend
End With
End Sub