+ Reply to Thread
Results 1 to 11 of 11

Limiting characters in text box content control

  1. #1
    Registered User
    Join Date
    04-16-2011
    Location
    Tallinn
    MS-Off Ver
    Excel 2010
    Posts
    34

    Limiting characters in text box content control

    Hi all, is there a good way to limit the number of characters in text box content control? I've been googling all over the place but all the answers were either VBA or just dead ends.

    Word 2010 is under the question.

    Thanks in advance!
    Last edited by Exceltrouble; 09-02-2016 at 02:36 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Limiting characters in text box content control

    The answer is VBA.

    How are you using the textbox? What kind of limitation do you want? Is there a reason that you don't want to or can't use VBA?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-16-2011
    Location
    Tallinn
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Limiting characters in text box content control

    They describe non VBA solution here: http://superuser.com/questions/80783...soft-word-2010

    I fail to follow these steps that are described there.

    Main reason for opting out from VBA is my own poor knowledge of it as well all kinds of problems users tend to run against when using macro based workbooks/documents.

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Limiting characters in text box content control

    You cannot limit the amount of text input into a content control without resorting to VBA. If you need that kind of functionality, you will need to use formfields. Do note, however, that you should not use formfields and content controls in the same document, as they weren't designed to work together, and formfields require Word's 'filling in forms' protection to work.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: Limiting characters in text box content control

    .
    .
    .
    I presume you are using a TextBox on a UserForm ? Refer to the image below:
    .
    .
    MaxLength.jpg
    .
    .
    .
    The image refers to the VBA editor. If you are using a UserForm with a TextBox, click on the TextBox then look to the left in the Properties
    settings. Locate MaxLength and set the total number of characters you desire.

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Limiting characters in text box content control

    Quote Originally Posted by Logit View Post
    I presume you are using a TextBox on a UserForm ?
    Why would you presume that, when the OP clearly said it's a:
    Quote Originally Posted by Exceltrouble View Post
    text box content control?
    Content controls and userforms are fundamentally different. For starters, userforms cannot be used without VBA; content controls can...

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Limiting characters in text box content control

    You can limit the length if you use a cell with Data Validation (custom formula) instead of a TextBox. Is there any reason you must use a textbox?

    At this point it would be helpful for you to attach your file. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

  8. #8
    Registered User
    Join Date
    04-16-2011
    Location
    Tallinn
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Limiting characters in text box content control

    Adding document where example text box content control has been added. Sometimes it is a bit mind boggling that instead having this as standard functionality, you need to engage in VBA. If this is the case of course

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Limiting characters in text box content control

    My mistake, I didn't notice this was in a Word forum; I accessed from the Unanswered Threads list. My answer about using a cell applies only to Excel.

    So we are back to VBA for your issue. I have not done this exact thing in Word so would have to develop the solution. I'll be back if I come up with it.

  10. #10
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Limiting characters in text box content control

    Quote Originally Posted by Exceltrouble View Post
    Sometimes it is a bit mind boggling that instead having this as standard functionality, you need to engage in VBA.
    As indicated in my previous reply, you can doing without VBA using formfields, but not when using content controls. If you're wedded to using content controls, though, see:
    http://gregmaxey.mvps.org/word_tip_p..._controls.html
    and, if you want to limit the length of whatever is input into one, see also:
    http://gregmaxey.mvps.org/word_tip_p...om_events.html

  11. #11
    Registered User
    Join Date
    04-16-2011
    Location
    Tallinn
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Limiting characters in text box content control

    Thanks guys, I opt out from VBA at the moment and simply go with instructional text

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Content Control Checkbox Hide and Show Text
    By schmidt1962 in forum Word Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2014, 11:10 PM
  2. [SOLVED] TextBox user input to change text in content control with VBA?
    By EnigmaMatter in forum Word Formatting & General
    Replies: 2
    Last Post: 09-06-2014, 06:56 PM
  3. Replies: 3
    Last Post: 04-05-2012, 04:58 PM
  4. control-M characters in text files output from Excel
    By embirath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2006, 01:44 AM
  5. Replies: 1
    Last Post: 08-16-2006, 10:55 AM
  6. Limiting Characters In Rows
    By Mdlee in forum Excel General
    Replies: 1
    Last Post: 05-16-2006, 12:00 AM
  7. Limiting physical length of text in a text box control
    By XL2Know in forum Excel General
    Replies: 1
    Last Post: 10-06-2005, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1