View Single Post
 
Old 11-13-2023, 01:27 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default Format paragraphs between Start and End

I'm trying to format paragraphs between Start and End, but my code fails. Can someone help? Thanks!
Code:
Sub StartEnd()
'Format paragraphs between Start and End
   Dim oRng As Range
  Set oRng = ActiveDocument.Range(Start:=64, End:=ActiveDocument.Paragraphs.Count)
    With oRng.Paragraphs
    For Each oPar In oRng.Paragraphs
              oPar.Style = "MyStyle"
    Next oPar
    End With
End Sub
Reply With Quote