faloana.blogg.se

How to delete full pages in word
How to delete full pages in word




Set dlgFile = Application.FileDialog(msoFileDialogFilePicker) Sub DeleteSentencesContainingSpecificWordsOnAList()ĭim objListDoc As Document, objTargetDoc As Documentĭim strFileName As String, strButtonValue As String

  • Next install and run a macro with the exact steps in method 1.
  • how to delete full pages in word

    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

    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

  • Then click “Insert” and choose “Module” to get a new one.
  • Next create a new module by clicking “Normal”.
  • To begin with, press “Alt+ F11” to trigger the VBA editor in Word.
  • Method 1: Find or Delete Sentences Containing Specific Text Today, however, we are delighted to tell you the macro way to find or delete sentences containing certain text. As you see, the target is a word or a phrase. Then we will have no problem in highlighting, replacing or removing them. It’s known to all that we can use the “Find and Replace” function in Word to easily find all occurrences of specific words. In this article, we will offer you 2 quick ways to find or delete sentences containing specific text in your Word.






    How to delete full pages in word