![]() |
|
#2
|
||||
|
||||
|
Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim DocSrc As Document, DocTgt As Document, Rng As Range
Set DocSrc = ActiveDocument: Set DocTgt = Documents.Add
With DocSrc.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "TROUBLE PHONE LINE FAIL"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWildcards = False
.Execute
End With
Do While .Find.Found
Set Rng = .Duplicate
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
DocTgt.Range.Characters.Last.FormattedText = Rng.FormattedText
Rng.Text = vbNullString
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Select rows w/cells containing given character strings, then sum cell in two other col.
|
LarryHills | Excel | 1 | 02-17-2017 03:55 PM |
How to Dim a substring between two strings
|
dwirony | Word VBA | 4 | 10-28-2016 07:51 AM |
| Select specific pages to print or save | Jack Byrindi | Word VBA | 0 | 01-16-2014 03:14 PM |
Buttons to select pages
|
greg__reynolds | Word | 1 | 08-30-2012 05:20 AM |
update style of all strings available between two specific strings
|
vikrantkale | Word | 1 | 03-28-2011 06:13 PM |