Sub TableJoiner()
Application.ScreenUpdating = False
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
With oPara.Range
If .Information(wdWithInTable) = True Then
With .Next
If .Information(wdWithInTable) = False Then
If .Text = vbCr Then .Delete
End If
End With
End If
End With
Next
Application.ScreenUpdating = True
End Sub
####
foreach my $oPara (%{$Word->ActiveDocument->Paragraphs})
{
if ($oPara->Range->Information(wdWithInTable))
{
if ($oPara->Next->Information(wdWithInTable) eq False)
{
if ($oPara->Next->Text eq "\r") #vbCr
{
logoutput("Deleting Line\n");
$oPara->Range->Next->Delete;
}
}
}
}
####
foreach my $oPara ($Word->ActiveDocument->Paragraphs)