![]() |
|
#6
|
||||
|
||||
|
Your latest code isn't the same as what you posted the first time. This line:
ActiveDocument.Range.InsertAfter "Just After The Set" & oRng.Text inserts content after the range you just defined with: Set oRng = ActiveDocument.Paragraphs.Last.Range Hence, oRng no longer points to the last paragraph! Your code should be something like: Code:
With ActiveDocument.Range
.InsertAfter vbCr & "Just After The Set " & .Paragraphs.Last.Range.Text
With .Find
.Text = "[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}"
.MatchWildcards = True
.Execute
.Forward = False
End With
If .Find.Found = True Then
.End = .Paragraphs.Last.Range.End - 1
If IsDate(.Text) Then ActiveDocument.Range.InsertAfter "It took this long: " & fcnCalcSpanStart_Finish(oRng.Text, Now)
End If
End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find and replace only paragraph marks in blank line
|
laith93 | Word | 4 | 04-27-2022 12:18 PM |
How to resize a paragraph range to include just a single line of text
|
Peterson | Word VBA | 5 | 07-08-2019 04:36 PM |
| Using DateValue to find if a date exists within a certain range | OfficeAssociate99 | Excel Programming | 3 | 07-13-2017 11:06 AM |
Find if Date range falls within another range
|
Triadragon | Excel | 3 | 05-02-2016 11:48 AM |
| Find a Date in a Range | rspiet | Excel | 3 | 02-15-2016 08:37 AM |