The procedure below will add the TBody element. It will be added just before the </table> end tag.
dim strHTML As String
strHTML = _
vbCrLf & _
vbTab & _
vbTab & _
"<tbody>" & _
vbCrLf & _
vbCrLf & _
vbTab & _
vbTab & _
"</tbody>" & _
vbCrLf
ActiveDocument.all.tags("table"). _
Item(0).insertAdjacentHTML _
"BeforeEnd", strHTML
'Save the changes.
WebDesigner.ActivePageWindow.Save True
HTML code before method was run:
<table>
<thead>
</thead>
<tfoot>
</tfoot>
</table>
HTML code after method was run. Note that the TBody element goes after the TFoot element according to the w3.org which says that "Tfoot must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the (potentially numerous) rows of data."
<table>
<thead>
</thead>
<tfoot>
</tfoot>
<tbody>
</tbody>
</table>