IF BLANK (MACRO)

R

Ralph

I have a Macro that runs in MS-Word. I need to find
out if a document that a user is referencing/opening/using
is BLANK.

If the Document is BLANK notify the user with a message.
If the document is NOT BLANK (i.e more that 10 characters)
notify the user with a message box.

Can anyone help me?
 
G

Greg Maxey

Ralph,

Something like this in an AutoOpen macro might work:

If ActiveDocument.Characters.Count < 10 Then
MsgBox "This document is empty", vbOKOnly, "Content"
Else: MsgBox "This document is not empty", vbOKOnly, "Content"
End If
 
J

Jean-Guy Marcil

Ralph was telling us:
Ralph nous racontait que :
I have a Macro that runs in MS-Word. I need to find
out if a document that a user is referencing/opening/using
is BLANK.

If the Document is BLANK notify the user with a message.
If the document is NOT BLANK (i.e more that 10 characters)
notify the user with a message box.

Please do not multipost.

If you want you can crosspost (Many newsgroups in the To: field when you
create your message.)

The reason is simple:
People may end up "wasting" their time answering a post that has already
been answered elsewhere, thus it may be very likely that their particular
response to a post be totally ignored if the reply received elsewhere was
satisfactory to the original poster.
--
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