SolvedPrivate

Create MS Word form issue

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now