View Single Post
 
Old 12-22-2015, 06:00 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,635
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Paul is right, however I thought the numbers in each paragraph was followed by the word "Segment"

This should work:
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
    If IsNumeric(oPar.Range.Characters(1)) Then
      Set oRng = oPar.Range
      oRng.Collapse wdCollapseStart
      oRng.MoveEndUntil ".", wdForward
      oRng.MoveEnd wdCharacter, 2
      oRng.Delete
    End If
  Next
  Set oRng = ActiveDocument.Range
  oRng.Text = Replace(oRng.Text, vbCr, "")
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote