Determine if Paragraph is emty-Word 2000

J

Jean-Guy Marcil

jbc was telling us:
jbc nous racontait que :
Hi,

How would I determine if a paragraph is empty before text is typed?

Thanks.

jbc

Play with this code to get you going:

Dim ParaRge As Range

Set ParaRge = Selection.Paragraphs(1).Range

If ParaRge.Words.Count = 1 Then
MsgBox "Current paragraph is empty"
ElseIf Len(Trim(ParaRge.Text)) = 1 Then
MsgBox "Current paragraph contains only spaces"
Else
MsgBox "Current paragraph is NOT empty"
End If


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top