This table looked rather odd. On closer inspection, it was not a table, but
totally created from individual drawing objects!! Each cell is its own text
box, and each border is a separate line!
Anyone got a rabbit in their hat for fixing this and making it a real table?
Ed
Hi Ed,
"Nothing is foolproof because fools are so ingenious!" ;-)
This chunk of code, applied to a copy of the original text, will
remove the text boxes and leave the contents of each "cell" as a
separate paragraph of plain text. (Use a copy because the code will
also kill off any direct formatting, such as indents or line spacing,
plus you'll need to refer to the original for the following step.)
Dim oTB As Shape
Dim oRg As Range
' convert all textboxes to frames
For Each oTB In ActiveDocument.Shapes
If oTB.Type = msoTextBox Then
oTB.ConvertToFrame
End If
Next oTB
' remove all applied para format
' which removes frames
Set oRg = ActiveDocument.Range
oRg.ParagraphFormat.Reset
After that, you'll have to manually move the text into the cells of a
real table. The problem with automating this is that the order of the
cleaned text paragraphs is unpredictable (it will probably the the
reverse of the order in which the original text boxes were created,
assuming they were all anchored in the same paragraph).