PDA

View Full Version : msgbox to appear when a command is executed in word



francozola25
11-20-2007, 02:40 PM
Hi i was wondering if someone could help me. I am currently trying to edit my normal.dot template. I want to have a warning message appear up when my user tries to insert a textfield onto the document.

I was wondering could this be done?

OTWarrior
11-21-2007, 02:40 AM
If you put the code in your normal.dot, then it is only available on your computer, unless you overwrite the users file.

It's best to have your code in a document only.

On to your main question, why not just disable the formfields toolbar, or do you still want them to add text formfields but give them a warning before they do?

francozola25
11-21-2007, 11:10 AM
Yeah i was just looking to have a warning message appear. I want the message to appear stating use of insert form field may cause problems. When they click OK on the message box they can continue to use it.

Many thanks for your reply

fumei
11-21-2007, 01:11 PM
You state: "insert a textfield", but the assumption is that you mean a text formfield. Which it seems you do. There is no such things a textfield. There are text formfields, and ActiveX textboxes.

The command to insert a text formfield is Sub TextFormField. So....

Sub TextFormField()
MsgBox "Text FormFields may cause difficulties."
End Sub

I have to say:

1. What problems do you think will happen?
2. What difference does giving the message make, if it just displays a message...and has no effect?

I can understand warning about ActiveX textboxes, as they can run code, and are affected by the Security level. Formfields are not.

What, exactly, are you concerned about?