View Single Post
 
Old 07-16-2015, 11:02 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

While Paul is a whizz with wildcards, based on your comments I would do it differently. If the required paragraphs always begin with four or 6 numeric characters, the required paragraphs can be obtained by analysing those characters at the start of each paragraph e.g.

Code:
Dim oPara As Paragraph
Dim oRng As Range
    For Each oPara In ActiveDocument.Paragraphs
        If IsNumeric(Left(oPara.Range, 4)) Or IsNumeric(Left(oPara.Range, 6)) Then
            Set oRng = oPara.Range
            oRng.End = oRng.End - 1
            'do what you want here with orng.text
            MsgBox oRng.Text
        End If
    Next oPara
__________________
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