Delete whole line in word doc
Posted on 2008-10-16
Using VB.Net I'm trying to delete a whole line in a word doc. I found the following function, but I can't get it to work! Any help would be appreciated. I would like the function to simply pass in the word doc that I'm already accessing, for example something like:
Private sub DeleteLine(ByRef doc As Object)
Anyways, below is the function I found, but I can't get it to work. I would like to delete the whole line where the word "Filed:" appears.
Selection.Find.Text = "Filed:"
Do While Selection.Find.Execute(FindText:="Filed:", Forward:=True, _
Format:=True) = True