SolvedPrivate

Create MS Word form issue

Posted on 2015-01-31
4
7 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 500 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Outlook Free & Paid Tools
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

810 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