PDA

View Full Version : Code to limit characters per line and number of lines



RonNCmale
03-09-2013, 11:11 AM
Is it possible to limit the number of characters per line, and number of lines in a text form field by using vba? I know about the text form field option to limit maximum length but it does not limit the number of characters per line. The only solution I have found is to place the text form field in a table and set the margins, and then protect the document.

Doug Robbins
03-09-2013, 05:08 PM
You could probably do something with the method in the article "How to validate thecontents of a formfield in a Word form” at:
http://www.word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm (http://www.word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm)
But using a table with fixed cell sizes is the most common method.