Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-05-2020, 11:24 PM
gmayor's Avatar
gmayor gmayor is offline Duplicate paragraphs except in tables Windows 10 Duplicate paragraphs except in tables 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

You would need another macro to delete the locked red formatted controls, remove the controls from the blue text and reformat as black e.g. as follows



Code:
Sub Macro2()
'Graham Mayor - https://www.gmayor.com - Last updated - 06 Mar 2020
Dim oCC As ContentControl
Dim IngCC As Long
Dim oRng As Range
    For IngCC = ActiveDocument.ContentControls.Count To 1 Step -1
        Set oCC = ActiveDocument.ContentControls(IngCC)
        If oCC.LockContents = True Then
            oCC.LockContentControl = False
            oCC.LockContents = False
            oCC.Range.Paragraphs(1).Range.Delete
            oCC.Delete
        Else
            oCC.LockContentControl = False
            oCC.Delete
        End If
    Next IngCC
    Set oRng = ActiveDocument.Range
    oRng.Font.ColorIndex = wdAuto
    With oRng.Find
        Do While .Execute(findText:="^13{2,}", MatchWildcards:=True)
            oRng.Text = Chr(13)
            oRng.ParagraphFormat.SpaceAfter = 12
            oRng.Collapse 0
        Loop
    End With
lbl_Exit:
    Set oRng = Nothing
    Set oCC = Nothing
    Exit Sub
End Sub
__________________
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
 

Tags
4605, copy/paste paragraph, tables



Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate paragraphs except in tables delete 1 or 2 adjacent duplicate paragraphs, macro moorea21 Word 4 11-01-2018 12:53 PM
Duplicate paragraphs except in tables How to find duplicate phrases/paragraphs in a long document iamgator Word VBA 5 12-27-2016 01:34 AM
Duplicate paragraphs except in tables Using VB.Net 2010 I cannot duplicate tables in the correct place AaaTeX Word Tables 3 08-03-2014 07:00 PM
Show & hide paragraphs, parts of tables, etc Preloader Word 2 10-19-2013 02:37 PM
Duplicate paragraphs except in tables add the functionality to show & hide paragraphs, parts of tables, etc pgwolfe Word 3 09-24-2013 07:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06: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