Reputation: 1646
I am using Microsoft Word 2010.
I have a document spanning thousands of pages. I need to write a macro that deletes every paragraph that begins with the string mystring
. How would I write this?
EDIT: I have figured out how to write a macro and how to delete a paragraph once my cursor is at the beginning of the paragraph. I need to find a way to do a "find" search
Upvotes: 1
Views: 67
Reputation: 8531
Dim d As Document
Dim p As Paragraph
Set d = ActiveDocument
For Each p In d.Paragraphs
If Left(p.Range, Len("Asdfsadfsdsd")) = "Asdfsadfsdsd" Then
p.Range.Delete
End If
Next p
Upvotes: 3