Max Length missing in field Properties Window

C

Craig

Re: Office 2007 - Word
Text fill-in field
Content Control Properties
Help: "forms" search results

Help says...
"To limit the amount of information a person can type in the field, set a
maximum width by selecting the field, clicking Properties in the Controls
group, and entering a value under Maximum length. "

Problem:
Properties does not contain "Maximum Length".
What do I do?
 
J

Jay Freedman

The help is referring to a text form field from the Legacy Tools button in
the Controls group.

A text *content control* (Rich Text or Plain Text) doesn't have any maximum
length that's settable. Instead, you must write macro code in the content
control Exit event handler. For example, if the particular content control
has a Tag value (assigned in its Properties dialog) equal to "ShortName",
then this code will complain if the content is too long:

Private Sub Document_ContentControlOnExit( _
ByVal CC As ContentControl, Cancel As Boolean)

If CC.Tag = "ShortName" Then
If (Not CC.ShowingPlaceholderText) And _
Len(CC.Range.Text) > 12 Then
MsgBox "Name must be no more than 12 characters."
CC.Range.Select
End If
End If
End Sub

See http://www.gmayor.com/installing_macro.htm if needed.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top