![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#5
|
||||
|
||||
|
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 |
| Tags |
| excel 2013, extract word to excel, word 2013 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to insert paragraph character after every 500 characters?
|
aditya_bokade | Word VBA | 28 | 11-13-2021 10:48 PM |
Macro to Insert text into the beginning on specific paragraphs unless the paragraph is blank
|
caboy | Word VBA | 2 | 04-01-2015 07:00 AM |
How can select from a specific character to another character
|
mohsen.amiri | Word | 2 | 02-19-2015 11:38 PM |
Replace paragraph-marks (line-breaks) in tables with a character-string
|
Aztec | Word VBA | 2 | 04-02-2013 10:52 PM |
| How to import a text file but skip the first line regardless of characters? | omahadivision | Excel Programming | 7 | 02-01-2013 08:30 PM |