Link to home
Start Free TrialLog in
Avatar of liyy
liyy

asked on

Create MS Word form issue

Hi,

Two questions:

Q1
I use MS Word 2010 to create a form and protect it, everything is fine, but I was wondering when I choose "Plain text Content control" or "Rich text content control", it doesn't allow me to restrict the field, e.g. only type the number instead of character, max. 3 digits, etc., I know I can use "Text form field" under Legacy Forms to accomplish them, but my boss doesn't want to see the background grey area if I add "Text form field"

Q2
When I enabled form and protect it, how can I allow end user to update the header, because when I protect the form, the header is locked.


Any suggestion?
Avatar of FarWest
FarWest

I think you have to  use VBA to do that
here is an Example to validate content control (Textbox, Radio Button , ..etc)
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
If ContentControl.Title = "Test" Then
If Val(ContentControl.Range.Text) < 4 Then 'don't accept less than 4
Debug.Print ContentControl.Range.Text
Cancel = True
End If
End If
End Sub

Open in new window

Avatar of liyy

ASKER

Thanks FarWest,

I am newbie of VBA developer, how about If I would like to control the text field only accept number and max 3 digits, thanks
ASKER CERTIFIED SOLUTION
Avatar of FarWest
FarWest

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of liyy

ASKER

sorry for the late, I temporarily accept it and I will post it if I got the problem again.