Required Form Fields for Templates

J

Jen

Has anyone used required fields in their Word templates?
We would like to have certain fields required to be
completed prior to the sender automatically routing the
completed template to the next user.
 
G

Greg Maxey

Jen,

If you use a protected form you can run a variation of the
following macro run on exit from the mandatory field:

Sub ExitText1()
With ActiveDocument.FormFields("Text1")
If Len(.Result) = 0 Then
Beep
Application.OnTime When:=Now + TimeValue
("00:00:01"), Name:="GoBacktoText1"
Set Balloon = Assistant.NewBalloon
With Balloon
.Text = "No Data!" & vbCr & "You must fill
in this FormField"
.Button = msoButtonSetOK
.Animation = msoAnimationBeginSpeaking
.Show
End With
End If
End With
End Sub

Sub GoBacktoText1()
ActiveDocument.Bookmarks("Text1").Range.Fields
(1).Result.Select
End Sub

By variation, I mean you will have to make a macro and
change "Text1" to the bookmark name of each mandatory
field.
 

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