MS Word Macro to Remove Specific Sentences - TechRepublic
Question
February 8, 2020 at 03:13 AM
dennisheljacobsen

MS Word Macro to Remove Specific Sentences

by dennisheljacobsen . Updated 6 years, 3 months ago

Dear all,

I came across this website and found a very helpful macro (here: https://www.techrepublic.com/article/macro-trick-how-to-highlight-multiple-search-strings-in-a-word-document/) for a particular research I am currently working on. The macro allows me to search for specific sentences in my word document, and highlight those sentences. However, I would like to be able to delete the focal sentences instead of simply highlighting them. The macro I use is to be found in the link above. Would any of you be able to help me write a bit more on the code so as to make it delete the sentences I put in to the macro (e.g.: WordCollection(0) = “here goes my first sentence – that is, one I would like to delete from the document”)?

All the best,
/Dennis Jacobsen.

All Comments