Hi,

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

Thanks.

jbc

Re: Determine if Paragraph is emty-Word 2000 by Jean-Guy

Jean-Guy
Tue Dec 13 12:38:44 CST 2005

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
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org