Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting and Limiting Words in Word 2007 Form Fields

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
Is there a way to limit the number of words in an input text field in Word 2007? I was handed a document with spaces for multiple text areas that they want word-limited with various limits and a countdown of words left (195/200, 454/750, etc.)

I found a couple of samples, but can't seem to get any to work, and then other posts suggest this can't be done and the available method is to simply set a text field in a fixed dimension table cell so it simply obscures the overflow text.


Yet I see a couple MVP posts like this:

The short answer is no. The best practical solution is to insert a text form
field in a table cell of fixed height and width of sufficient size to
accommodate the required amount of text. The user will be able to type more
than will fill the cell, but should soon get the idea that there will be no
space for it as it disappears of the page.
Do not use ActiveX fields in a document designed to be filled in Word. Use
the legacy form fields.
--
Graham Mayor - Word MVP"
 
Technically, you could do this via a SelectionChangeEvent, but that imposes significant overheads on everything you do in the document. Neither of the links you posted will give a dynamic word count for a text formfield or a text content control. In any event, limting by word count is counterproductive - would you rather your users use 600 small words or 400 enormous words? A character count might make more sense, but better stil (IMHO) is to give the users a fixed space into which they can type whatever they need to say. The visual que will more than suffice for a limit indicator for most users and no code is required.

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top