Go Premium for a chance to win a PS4. Enter to Win

x
?
SolvedPrivate

Create MS Word form issue

Posted on 2015-01-31
4
Medium Priority
?
12 Views
Last Modified: 2016-02-12
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?
0
Comment
Question by:liyy
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:FarWest
ID: 40582217
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

0
 

Author Comment

by:liyy
ID: 40582240
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
0
 
LVL 12

Accepted Solution

by:
FarWest earned 1500 total points
ID: 40582517
if you mean the field will force user to input  numbers with specific digits, this was before with maskedit control (I can't see it now), but if you mean the field will reject loosing focus until user entered valid data then it can be done by code above using >, <  operators
if you need help on how to add vba just press alt-f11 to open code editor and make sure that you are on "ThisDocument" in object explorer at the left window

Regards
0
 

Author Comment

by:liyy
ID: 40641626
sorry for the late, I temporarily accept it and I will post it if I got the problem again.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question