Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word - Form Field Question 1

Status
Not open for further replies.

Mensch

Technical User
Oct 13, 2003
5
US
I am creating a form in MS Word 2000 and am using the text form fields so the user can enter information. I set the parameters of the form field at a certain number of characters so that the field cannot expand beyond the size of the table box. I also lock the row height. However, if the user, instead of entering in text information, hits "Enter", it still skews the box. Does anyone have a suggestion about how to remedy?
 
Skip - I have never used macros before. The little bit of info in MS Word HELP isn't enough to direct me. Can you advise?
 
I am no Word guru, but here's s shot...
Code:
Sub StripCRLF()
    For Each ff In FormFields
        sOut = ""
        For i = 1 To Len(ff.Result)
            b = Mid(ff.Result, i, 1)
            Select Case b
              Case vbCr, vbLf
              Case Else: sOut = sOut & b
            End Select
        Next
        ff.Result = sOut
    Next
End Sub
See if this works ;-)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top