View Single Post
 
Old 03-05-2020, 11:24 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 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