Thread: [Solved] Collecting style text
View Single Post
 
Old 03-13-2022, 03:24 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
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

That should be simple enough. Try the following
Installing Macros

Code:
Sub Macro1()
Const sName As String = "Strong"    ' the name of the character style
Dim orng As Range
    Set orng = ActiveDocument.Range
    With orng.Find
        .Style = sName
        .Text = ""
        Do While .Execute
            ActiveDocument.Range.InsertAfter orng.Text & vbCr
        Loop
    End With
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