View Single Post
 
Old 11-09-2023, 09:10 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You kind of have your answer already in this thread


Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
 Dim oPar As Paragraph
 Dim oRng As Range
   With ActiveDocument
     Set oRng = .Range
     oRng.Start = .Paragraphs(3).Range.Start
   End With
   'Format unnumbered subtitles
   For Each oPar In oRng.Paragraphs
     If oPar.Range.ComputeStatistics(wdStatisticLines) = 1 _
          And oPar.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft _
          And Not oPar.Range Like "*[0-9]*" Then
       oPar.Range.Style = "Body Text"
     End If
   Next oPar
 lbl_Exit:   Set oPar = Nothing
   Exit Sub
 End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote