![How to delete full pages in word](https://cdn1.cdnme.se/5447227/9-3/2_64e61dfa9606ee7f98e9879b.png)
Set dlgFile = Application.FileDialog(msoFileDialogFilePicker) Sub DeleteSentencesContainingSpecificWordsOnAList()ĭim objListDoc As Document, objTargetDoc As Documentĭim strFileName As String, strButtonValue As String
![how to delete full pages in word how to delete full pages in word](https://www.lifewire.com/thmb/KL2mG0rH-GbX0tBPTQw5BZbzWxk=/774x0/filters:no_upscale():max_bytes(150000):strip_icc()/C3-DeleteaPageinGoogleDocs-annotated-051d7734566c4ef299102697f98e7f20.jpg)
Make sure each piece of text occupies one paragraph with no trailing space. First put all target texts on a new document.To meet the need of multiple searching, we will provide you another macro. Certainly, you can run the macro repeatedly to search for find multiple instances of words or phrases. With the macro in method 1, you can only search for one word or phrase a time. Method 2: Find or Delete Sentences Containing Any Text on a List Namely, the macro takes you to step through the whole document, finding target sentences and asking your confirmation every time. After the confirmation, the next sentence with designated text is in selection.Click “Yes” to delete the sentence and “No” to keep it.
![how to delete full pages in word how to delete full pages in word](https://bertinsfashion.com/pictures/how-to-delete-blank-page-at-end-of-word-document.png)
Then you shall see a sentence containing the text in selection with a message box prompting up.Just type the common text that all sentences contain. There will be an input box, asking you to enter text.StrButtonValue = MsgBox("Are you sure to delete the sentence?", vbYesNo) ' Expand the selection to the entire sentence. StrTexts = InputBox("Enter texts to be found here: ") Sub DeleteSentencesContainingSpecificWords()
![how to delete full pages in word how to delete full pages in word](https://www.journeybytes.com/wp-content/uploads/2021/07/word-text-boundaries.png)
![How to delete full pages in word](https://cdn1.cdnme.se/5447227/9-3/2_64e61dfa9606ee7f98e9879b.png)