Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form field (Word 2000)

    I have created a field in a Word TEMPLATE to contain text, ...narrative field...(there are two of them, and this is only one page of 5 in the report, its to large to send it all) I am uploading it to you so you can look at it. the problem is this: If I allow an unlimited character length to be typed in this field and the person keeps typing past the last line (this is just a jpeg image in the background), then they push the other pages out of sequence in the rest of the report below this page. I cannot be sure who will type in caps, and who will not, so putting a limit on this field is out of the question. I need a way to stop them from passing the last line of the narrative. Can you help? I should ADD that I have tried a FRAME, but cannot see the form field behind the frame once I paste the JPG of the lines inside it. Is there a macro I could use on entry/exit within this field?
    This is a report that I have spent weeks on, and it is the last stumbling block for me. If you could help, I'd be eternally greatful.
    thank you,
    nannette m. padgett
    Attached Files Attached Files
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    I modified the original message, since I posted it...stating that I've tried a frame, and was wondering about an on entry/exit macro. Thank you
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Form field (Word 2000)

    Can you use a table with a fixed cell size to hold your form fields?

    I'm not sure about the "out of sequence" remark. You might want to look into using StyleRef fields in your headers-footers.
    Charles Kyle Kenyon
    Madison, Wisconsin

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    I am using a table with the fields in each cell. The properties of each field for character space is what I am using for each field...except when it comes to the Narrative section. It is an Unlimited character field at this time...because typing all W's for length doesn't help those who type in lower or mixed case. They can't type but half of the field in before they run out of room, because 750 W's take a lot more space then 750 lower case letters. I need a way to stop their typing when they reach the last line, or they keep right on typing and it pushes the rest of the report down page by page. I don't want them to type past line 16 of the jpeg image in the background of the narrative field. I need a bit of code to allow them to wrap 16 times and no more then 16 times within this field no matter if they type in upper or lower case font. Anybody help me? I appreciate all suggestions.
    Nannette
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Still searching for help

    Anyone with a bit of code knowledge to make a user stop typing after 16 lines of text entry would be my HERO. This would be for the example attachment above, and on one stand alone field called Narrative.
    Nannette M Padgett <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Form field (Word 2000)

    You can make the table cell a fixed size (height/width). If they don't use it all, the part they don't use remains blank and is printed as blank. If they type more than fits, it is cut off by the bottom of the cell.

    This isn't a perfect solution but it may do what you need. Another imperfect solution would be to format that response using a fixed-width font such as Courier-New. Then upper-case W's use the same amount of space as lower-case i's. That would still allow them to mess things up with the Enter key.

    Generally, with forms that I want to look like forms, I do format all responses to be in Courier-New anyway, so it looks as if it was typed on a typewriter.

    I guess I would suggest using both methods. First format it as Courier-New and set a character limit. Then fix the size of the cell so that it does not automatically expand but just stays that size regardless of content.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Still searching for help

    I don't know of any way to make someone stop typing in a form field. However, you could try this as your "on exit" macro:
    <pre>Sub CheckLinesInFormField()
    Dim rngFF As Range, rngFFend As Range, intFFlines As Integer
    ' Set a range to the entire narrative form field
    Set rngFF = ActiveDocument.FormFields(81).Range
    ' Set a second range to the very end of the form field
    Set rngFFend = rngFF.Duplicate
    rngFFend.Collapse Direction:=wdCollapseEnd
    ' Calculate the number of lines of text in the form field
    intFFlines = rngFFend.Information(wdFirstCharacterLineNumber) - _
    rngFF.Information(wdFirstCharacterLineNumber) + 1
    ' If there are more than 16 lines, alert user and return to field
    If intFFlines > 16 Then
    MsgBox "Squeeze your narrative into 16 lines, or else."
    'command to cancel exit from form field
    End If
    ' Clean up range objects
    Set rngFF = Nothing
    Set rngFFend = Nothing
    End Sub</pre>

    Since I basically know next to nothing about form fields and "on exit" macros, I don't know the best way to handle the line in bold above. Perhaps you already know that part. Hope this helps.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    I see your point about a table -- to maleable. You could control the number of rows programmatically, but not the size of each row (well, maybe you can, but it would be ugly). So tables are out. I did think about PDF (which would probably work), but you want to stick with the Word document model, right?

    So, the only thing I could get to work is a text box. But that has its problems too. For one, text boxes don't work in documents protected for forms. There goes your formfields.

    Another problem: there is no way to get your jpg "lines" as a background to the text box. Even a VBA Userform text box cannot have a backgroud graphic (not that I can see). Why do you have to have a "ruled" narrative box? If you could pitch the lines, I could show you code that only allows text typed into the text box as sized.

    One possibility for you is to gather all the data in a userform; then have the code populate all your fields in the live document "form". The judge sees the piece of paper and it looks perfect. The user interacts with a VBA userform (what do they care how the data goes in?) and you can control the data entry to the nth degree.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    Kevin,
    Gathering all the data in a userform, looks like an interesting possiblility. Could you elaborate just a little about how to make this a possiblity. It would be something new to me. I am good at gathering concepts, and applying them, but this is a new one. Could you go into a little more depth on this one? Thank you for taking the time to look at this for me. It means a great deal.
    Nannette <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    Well, do you know how to create a VBA project? That's the starting point. If not, see here first.

    The basic idea is to create a template with userforms and some code mods that put userform fields on the screen for the user to fill in. When the form is complete (the user presses the Ok button), your code puts the userform field values they entered into the document. The document can use formfields, bookmarks, references to customdocument properties or document variables (what else guys??) to hold the values.

    Your doucument has 81 fields, so it's a bit labor intensive to set this up, but the control, data validation, etc. make it well worth it, IMHO. The user never really needs to touch the document. Your userform can control the data entry, formatting, printing, emailing, whatever.

    Here's just a small sample userform that presents the user with required fields for an underlying document.
    Attached Images Attached Images
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    Yes, I have taken several classes in VB, but not perfect at it. I know how to create a form. I have been working on the code in fact to fill in a form, and a bit of code that i was given in a previous response, has got me working in circles I believe, but in the right direction. Still need the line of code that makes the user stop typing after 16 lines, instead of saying "Or else"...or else, you just ruined my report dude..."whether they are typing into a nice looking form as you have pictured here, or whether they are typing into the narrative form popup that my code creates...The InPutBox that I have now, still doesn't limit the user Input to 15 or 16 lines. I can see I have exhausted all avenues, and am not going to push my luck with all of you here, I depend on your Input to much to wear you ragged. Thanks so much for all your help, and will work on every reply I was given.
    NMPadgett
    I salute you!
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    Ok, then. On your userform, create a text box. Set its wordwrap and multiline properties to true. In the textbox change event put this code:

    Private Sub TextBox1_Change()
    If Me.TextBox1.LineCount > 16 Then
    MsgBox "Too many lines. Limit 16."
    Me.TextBox1.SetFocus
    End If
    End Sub

    The change event fires with each keypress. You'll get 16 lines max. That should do it.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. #13
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    I think this is going to work. thank you for all your patience and time. could i ask one more thing...(ducking head)...I removed the Set focus part of it, and the problems I was having are all gone. However, in Design view, I can see my JPG image lines in the background just fine. But when I leave design view, the image disappears behind my form field and when print time comes it cannot be seen, nor while I'm typing. The Order control, right click, bring to front, send to back don't do anything. I've made the field transparent, but turns white upon leaving design view. Any ideas? Thanks for your patience folks, You are the greatest.
    Nannette
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  14. #14
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    I am sorry, my last message asked about the JPEG lines, and you've already told me its a no deal in a user form. I'm sorry. Your code worked after I removed the setfocus line, and you've saved me from exhaustive collapse on this one. If I can work out the line deal here somehow, I will be done. Thank you for all your "kewl" help. And I do Salute you sir.
    NMPadgett <img src=/S/salute.gif border=0 alt=salute width=15 height=20>
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  15. #15
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form field (Word 2000)

    You mean like this?:
    Attached Images Attached Images
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Page 1 of 2 12 LastLast

Posting Permissions

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