July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.
Private Sub Command1_Click() Dim objMSWord As Word.Application Dim myDOc As Word.Document Set objMSWord = CreateObject("Word.Application") Set myDOc = objMSWord.Documents.Open("C:\Users\Alpesh\Desktop\111114.txt") For Each p In myDOc.Paragraphs If InStr(p.Range.Text, "BlockedIP") > 0 Then 'Skipping - found text Else p.Range.Delete End If Next myDOc.SaveAs ("c:\Users\Me\Desktop\052214_2.txt") myDOc.Close Set myDOc = Nothing objMSWord.Quit End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.