How do I create an message box when opening a Word document?

A

Annie1904

I often create a message box in Excel, for documents I share with colleagues,
but can't find a way of making this work in word. In Excel, I use visual
basic editor to add a macro to a workbook using the following

Private Sub Workbook_Open()
MsgBox ("message, etc")
End Sub

How do I do something similar in Word - by any method?
 
C

Charles Kenyon

Sub AutoOpen
MsgBox "message, etc"
End Sub
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
A

Annie1904

Super Charles! I did have to change the security level on the document to
low, but apart from that it worked well.
 
C

Charles Kenyon

There is _not_ a security level for documents. The security level you
changed is for the Word application!

Change it to medium. That way people are asked to approve running the macro.
That is one of the reasons people don't advise putting macros in documents.

Consider, instead, putting a borderless text box in your document with the
same information. Mark the text in the textbox "hidden" and put it in a
different font and color. Make the background transparent and put it in a
margin. Have it float in front of text rather than have the text in the
document wrap around it. Your users can see it but it won't print.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

Doug Robbins - Word MVP

You should put the macro in the template from which the documents are being
created. Of course, if they are just based on the Normal.dot template, that
may not be practical as the message box would appear when any document was
opened.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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