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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top