Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
bixcel bixcel is offline
external usenet poster
 
Posts: 1
Default v2007: Text control (plain text): How to restrict length of data?

I am using Word 2007.

I have set up a user input form which includes drop-down list controls and
plain text content controls.

(1) How do I restrict the number of characters that may be entered in a
plain text content control?
(I am aware that the legacy text form field allow you to set the maximum
length, but I do NOT want to use the old (legacy) method.)

(2) How do you stop carriage returns being entered in legacy text form fields?
(I am aware that the plain text content control gives an option to turn this
on/off.)

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default v2007: Text control (plain text): How to restrict length of data?

Hi ?B?Yml4Y2Vs?=,

I am using Word 2007.

I have set up a user input form which includes drop-down list controls and
plain text content controls.

(1) How do I restrict the number of characters that may be entered in a
plain text content control?
(I am aware that the legacy text form field allow you to set the maximum
length, but I do NOT want to use the old (legacy) method.)

When the Word team was designing content controls there was a basic decision
made to *not* try to leverage Word as a "forms tool". InfoPath was designed for
this, so strict data gathering over a form is considered to be InfoPath's job.
Content Controls in Word are meant to help steer document creation. Thus, we
don't have any checkbox content controls, and no forms-type limitation
capabilities (such as limiting the type of characters, or how many characters
can be entered).

Best you could do would be a macro that triggers when the user exits the field.
It would check how many characters the field contains and take an action if
there were too many. (Delete them, return the to field, display a message...)

(2) How do you stop carriage returns being entered in legacy text form fields?
(I am aware that the plain text content control gives an option to turn this
on/off.)

There's a KB article with a macro that can prevent the user typing Enter within
a form field. See

http://support.microsoft.com?kbid=211219


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
p0 p0 is offline
external usenet poster
 
Posts: 254
Default v2007: Text control (plain text): How to restrict length of data?

On 15 jan, 11:29, Cindy M. wrote:
Hi ?B?Yml4Y2Vs?=,

I am using Word 2007.


I have set up a user input form which includes drop-down list controls and
plain text content controls.


(1) How do I restrict the number of characters that may be entered in a
plain text content control?
(I am aware that the legacy text form field allow you to set the maximum
length, but I do NOT want to use the old (legacy) method.)


When the Word team was designing content controls there was a basic decision
made to *not* try to leverage Word as a "forms tool". InfoPath was designed for
this, so strict data gathering over a form is considered to be InfoPath's job.
Content Controls in Word are meant to help steer document creation. Thus, we
don't have any checkbox content controls, and no forms-type limitation
capabilities (such as limiting the type of characters, or how many characters
can be entered).

Best you could do would be a macro that triggers when the user exits the field.
It would check how many characters the field contains and take an action if
there were too many. (Delete them, return the to field, display a message...)


There is an option which does exactly what you want, though it is a
highly complex one.

It is possible to map your content control to a piece of custom xml
within your document. And it is possible to define an xml schema for
that custom xml. In the schema you can define your xml elements as a
string type with limitations in length (and allowed characters). If
you assign that schema to your Word document, you can use it for
validation. Then if someone would enter more than your given number of
characters, a curly red line would appear under their input and they
wouldn't be able to save the document. Right clicking the underlined
part would even tell them what they did wrong. The problem is that by
default, the mapping of content controls and custom xml is not
entirely straightforward. You would probably need tools like
http://www.codeplex.com/Wiki/View.aspx?ProjectName=dbe

On a side note, although rather complex, custom xml is actually the
way to go as it would allow you to easily extract and manipulate the
entered data afterwards.

Yves

  #4   Report Post  
dogtrainer dogtrainer is offline
Junior Member
 
Location: Massachusetts
Posts: 0
Default

I was just looking for a solution to this myself and came across this forum. I was having a similar problem in my doc (Word 2010).

In my case, the form was created using tables, and then applying content control to specific cells. However, in one case I could not prevent the rich text control (within the cell of a table) from running off the page.

However in one of my other tables in the same document, the rtc box was allowing wrapping. I solved my problem by copying and reformatting the table that allowed wrapping to suit my need in the original space.

I don't know why in one case text wrapping occurred and not in the other. I double checked and it looked like in both tables text wrapping was selected.


Quote:
Originally Posted by bixcel View Post
I am using Word 2007.

I have set up a user input form which includes drop-down list controls and
plain text content controls.

(1) How do I restrict the number of characters that may be entered in a
plain text content control?
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for TEXT Box to Plain Text Conversion? binar Microsoft Word Help 1 July 30th 07 10:36 PM
Auto-Correct - Plain Text or Formatted Text toggle is disabled Rickijayne Microsoft Word Help 1 May 16th 07 05:16 PM
plain text in text box does not print - Word 2003 mdbg Microsoft Word Help 5 December 6th 06 10:20 PM
How do I save a file as Text Only versus Plain Text? Jessi Microsoft Word Help 9 July 6th 06 05:47 AM
how do I change plain text to normal text Doug Geddes Mailmerge 1 May 5th 06 03:08 PM


All times are GMT +1. The time now is 02:08 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"