Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Is there any way to set up constraint for word count? Thanks
|
#2
![]() |
|||
|
|||
![]()
You can limit the number of characters, or you can limit the number of lines
by putting a text form field in a table cell with Exact height, but there is no way (that I am aware of) to limit words. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Linda" wrote in message ... Is there any way to set up constraint for word count? Thanks |
#3
![]() |
|||
|
|||
![]()
Linda,
If you mean that you want to limit the number of words in a particular formfield then yes you can use the following series of macros. Private mstrFF As String Sub OnExit() Dim i As Long Dim myRange As Range Set myRange = ActiveDocument.Bookmarks("Text1").Range i = myRange.ComputeStatistics(wdStatisticWords) With GetCurrentFF If i 5 Then MsgBox ("Field word counts exceeds limit of 5.") mstrFF = GetCurrentFF.Name End If End With End Sub Public Sub OnEntry() Dim strCurrentFF As String If LenB(mstrFF) 0 Then ActiveDocument.FormFields(mstrFF).Select mstrFF = vbNullString End If End Sub Private Function GetCurrentFF() As Word.FormField With Selection If .FormFields.Count = 1 Then Set GetCurrentFF = .FormFields(1) ElseIf .FormFields.Count = 0 And .Bookmarks.Count 0 Then Set GetCurrentFF = ActiveDocument.FormFields _ (.Bookmarks(.Bookmarks.Count).Name) End If End With End Function Set the OnExit macro to run when exiting the field you want to contrain. Set the OnEntry macro in the next formfield in the sequence. See: http://www.gmayor.com/formfieldmacros.htm for more on this method. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limit quantities on a form template in Word | Microsoft Word Help | |||
In typing dates in Word, i.e. "January 12" how do you keep the "1. | Microsoft Word Help | |||
WordPerfect - copying formatting | Page Layout | |||
saving the workspace | Microsoft Word Help | |||
How do I convert a cd in word perfect to microsoft word | Microsoft Word Help |