Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-04-2019, 02:22 PM
macropod's Avatar
macropod macropod is offline Select and Cut Certain Pages Containing Certain Strings? Windows 7 64bit Select and Cut Certain Pages Containing Certain Strings? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select and Cut Certain Pages Containing Certain Strings? Select rows w/cells containing given character strings, then sum cell in two other col. LarryHills Excel 1 02-17-2017 03:55 PM
Select and Cut Certain Pages Containing Certain Strings? 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
Select and Cut Certain Pages Containing Certain Strings? Buttons to select pages greg__reynolds Word 1 08-30-2012 05:20 AM
Select and Cut Certain Pages Containing Certain Strings? update style of all strings available between two specific strings vikrantkale Word 1 03-28-2011 06:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft