View Single Post
 
Old 10-17-2020, 07:46 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I've had problems with table edge cases such as when a table is the first thing in a document. The consistent way I get around it is to use Word's insert caption which seems to avoid that issue and may well also work on your butted tables. I can't produce two butted inline tables without them merging - perhaps you are floating your tables?

In any case, try this approach which may work with your doc.
Code:
Sub aTest()
  Dim oTable As Table, oRng As Range, oFld As Field
  For Each oTable In ActiveDocument.Tables
    Set oRng = oTable.Range
    oRng.InsertCaption Label:=wdCaptionTable, ExcludeLabel:=True, Position:=wdCaptionPositionBelow
    oRng.InsertCaption Label:=wdCaptionTable, ExcludeLabel:=True, Position:=wdCaptionPositionAbove
  Next
  For Each oFld In ActiveDocument.Fields
    If LCase(oFld.Code) Like "*seq table*" Then oFld.Delete
  Next oFld
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote