Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2020, 07:46 PM
Guessed's Avatar
Guessed Guessed is offline Insert a Paragraph mark before and after a table Windows 10 Insert a Paragraph mark before and after a table Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert a Paragraph mark before and after a table Indention below paragraph mark... kikola Word VBA 13 05-26-2020 06:21 AM
Paragraph mark added on the top of every second page aptbs00 Word 6 09-14-2018 03:53 PM
Insert a Paragraph mark before and after a table Replace space with paragraph mark jeffreybrown Word VBA 8 08-22-2018 03:31 PM
Insert a Paragraph mark before and after a table can't delete paragraph mark at end of document kb Word 10 10-06-2017 02:32 PM
Insert a Paragraph mark before and after a table Final paragraph mark Caroline Word 2 02-22-2011 10:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft