Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
|
|||
|
|||
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. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for TEXT Box to Plain Text Conversion? | Microsoft Word Help | |||
Auto-Correct - Plain Text or Formatted Text toggle is disabled | Microsoft Word Help | |||
plain text in text box does not print - Word 2003 | Microsoft Word Help | |||
How do I save a file as Text Only versus Plain Text? | Microsoft Word Help | |||
how do I change plain text to normal text | Mailmerge |