Forum Discussion
Jin_Quan1010
Jun 01, 2024Copper Contributor
Regarding batch page delete for word
How do I batch delete entire pages containing a specific word or can I find multiple pages with specific word to extract the entire page? Thanks!
Jin_Quan1010 Use a macro containing the following code
Dim strFind As String strFind = InputBox("insert the word to be found") Selection.HomeKey wdStory With Selection.Find Do While .Execute(FindText:=strFind, Forward:=True, _ MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=True) = True ActiveDocument.Bookmarks("\page").Range.Delete Loop End With