View Single Post
 
Old 07-22-2019, 03:13 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

So that would be the "next" paragraph:


Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oRng As Range
  For Each oPar In ActiveDocument.Paragraphs
    Select Case oPar.Style
      Case "Heading 1", "Heading 2", "Heading 3" 'etc.
        Set oRng = oPar.Next.Range
        oRng.End = oRng.End - 1
        oRng.Text = "Start " & oRng.Text & " End"
    End Select
  Next oPar
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote