Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 10-17-2020, 12:44 AM
gmayor's Avatar
gmayor gmayor 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: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following will work as requested
Code:
Dim oTable As Table
Dim oRng As Range
    If Selection.Information(wdWithInTable) = True Then
        Set oTable = Selection.Tables(1)
        Set oRng = oTable.Range
        oRng.Collapse 1
        oRng.Select
        Selection.SplitTable
        Set oRng = oTable.Range
        oRng.Collapse 0
        oRng.InsertParagraphAfter
    Else
        MsgBox "Selection is not in a table", vbCritical
    End If
    Set oTable = Nothing
    Set oRng = Nothing
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



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 11:39 AM.


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