dado_maker,
This can most likely be improved, but seems to work. This macro looks for
the string ????? in a paragraph object. If found, then is looks for a line
break. If the line break "is not" found then the whole paragraph
(supposedly a single line paragraph in your case) is deleted. If a line
break is found, then the the paragraph range is set to myRange, myRange is
then collasped then the end is moved to the line break + 1 (or then end of
the line including the break) and myRange is deleted.
Sub ScratchMacro()
Dim myRange As Range
Dim oPar As Paragraph
For Each oPar In ActiveDocument.Paragraphs
If InStr(oPar.Range.Text, "?????") Then
If InStr(oPar.Range.Text, Chr(11)) Then
Set myRange = oPar.Range
myRange.Collapse
myRange.MoveEndUntil (Chr(11))
myRange.MoveEnd Unit:=wdCharacter, Count:=1
myRange.Delete
Else
oPar.Range.Delete
End If
End If
Next
End Sub

Signature
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
> After finding a line that contains a word, how do I delete the whole
> line with VB code? The line can end with a Paragrapgh marker or a
> line break.
>
> Thanks,
> dado_maker
dado_maker - 31 Dec 2004 06:06 GMT
Greg,
Thanks! Is there a VBA for MS Word out there you would recomend?
Thanks,
dado_maker
> dado_maker,
>
[quoted text clipped - 35 lines]
> > Thanks,
> > dado_maker
Greg Maxey - 31 Dec 2004 17:09 GMT
dado_maker,
I haven't read any books on VBA. I don't know much and all that I do know
is from diving in to these newsgroups, asking lots of questions, and reading
the material at the MVP site.

Signature
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
> Greg,
>
[quoted text clipped - 43 lines]
>>> Thanks,
>>> dado_maker