Am currently using the script shown to remove paragraphs from a document. However my VBA is not that advanced and I now have 15+ keywords where I need the paragraphs removed (+ paragraph above the occurence). I am basically just repeating the script for each keyword, but this ends up being fairly slow as Word has to iterate through the document up to 15 times.
Is there a way to write the code more efficeintly and just supply say a hard coded comma seperated list of keywords to look for?
For Each para In ActiveDocument.Paragraphs
.Text = "NUMBERONFORM"
.Replacement.Text = ""
.Forward = True
'.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
If Selection = "NUMBERONFORM" And Selection.Information(wdWithInTable) = False Then
Selection.MoveUp unit:=wdParagraph, Count:=1
Selection.MoveDown unit:=wdParagraph, Count:=2, Extend:=wdExtend
Selection.MoveDown unit:=wdParagraph, Count:=1