Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
No multi-line field
I a form is to possible to NOT allow multi-line input?
As it is, a person CAN hit the return-key, even if you've specified a limited number of characters. If the return-key is hit, a 2nd line will appear, but it's not visible (if the row has a exact height, which is the case here). Regards, JeLa |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
No multi-line field
Hi JeLa,
You could add a macro to the document to either: .. test the formfield for the presence of a carriage return and, if found, delete it; or .. make the enter key take you to the next formfield (as happens with the tab). The following macro will remove the carriage returns from all data entry formfields in the document. You could call it from each formfield as an on-exit macro, or from just one formfield (eg the last formfield to be filled in). Alternatively, you could intercept the document save/print routines. Sub FFClean_Up() Dim FrmFld FormField For Each FrmFld In ActiveDocument.FormFields If FrmFld.Type = wdFieldFormTextInput Then FrmFld.Result = Replace(FrmFld.Result, vbCr, "") Next End Sub You could also modify the code so that it removes the enter keys from nominated formfields only. To see how to make the enter key behave like the tab key, go to: http://support.microsoft.com/default.aspx/kb/211219 Cheers -- macropod [MVP - Microsoft Word] ------------------------- wrote in message ... I a form is to possible to NOT allow multi-line input? As it is, a person CAN hit the return-key, even if you've specified a limited number of characters. If the return-key is hit, a 2nd line will appear, but it's not visible (if the row has a exact height, which is the case here). Regards, JeLa |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
No multi-line field
Thanks, but this is difficult stuff for me. I have to confess that my
macro-skills are zero. I did try it, thogh, but it didn't work. Then I checked the macro and got an compilation error in the line 'Dim FrmFld FormField'. It said it expected an end of command (or something like that) instead of 'FormField'. Then I tried the macro suggested on the support-page you gave me. I got the error saying that this was a key that couldn't be modified (or something like that) Jenny On Apr 4, 11:22 pm, "macropod" wrote: Hi JeLa, You could add a macro to the document to either: . test the formfield for the presence of a carriage return and, if found, delete it; or . make the enter key take you to the next formfield (as happens with the tab). The following macro will remove the carriage returns from all data entry formfields in the document. You could call it from each formfield as an on-exit macro, or from just one formfield (eg the last formfield to be filled in). Alternatively, you could intercept the document save/print routines. Sub FFClean_Up() Dim FrmFld FormField For Each FrmFld In ActiveDocument.FormFields If FrmFld.Type = wdFieldFormTextInput Then FrmFld.Result = Replace(FrmFld.Result, vbCr, "") Next End Sub You could also modify the code so that it removes the enter keys from nominated formfields only. To see how to make the enter key behave like the tab key, go to:http://support.microsoft.com/default.aspx/kb/211219 Cheers -- macropod [MVP - Microsoft Word] ------------------------- wrote in ... I a form is to possible to NOT allow multi-line input? As it is, a person CAN hit the return-key, even if you've specified a limited number of characters. If the return-key is hit, a 2nd line will appear, but it's not visible (if the row has a exact height, which is the case here). Regards, JeLa |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
No multi-line field
Hi Jenny,
Then I checked the macro and got an compilation error in the line 'Dim FrmFld FormField'. Dim FrmFld as FormField don't know about the rest of the code. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Vista Small Business, Office XP |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
No multi-line field
Hi Jenny,
Sorry about the error in the code I posted. That line should have read 'Dim FrmFld As FormField'. As for the code on the Microsoft site, it should work with Word 2000 and later, but you'll need to follow the instructions carefully. If you're using Word '97, there's a link there to a page with code for that version too. Cheers -- macropod [MVP - Microsoft Word] ------------------------- wrote in message ... Thanks, but this is difficult stuff for me. I have to confess that my macro-skills are zero. I did try it, thogh, but it didn't work. Then I checked the macro and got an compilation error in the line 'Dim FrmFld FormField'. It said it expected an end of command (or something like that) instead of 'FormField'. Then I tried the macro suggested on the support-page you gave me. I got the error saying that this was a key that couldn't be modified (or something like that) Jenny On Apr 4, 11:22 pm, "macropod" wrote: Hi JeLa, You could add a macro to the document to either: . test the formfield for the presence of a carriage return and, if found, delete it; or . make the enter key take you to the next formfield (as happens with the tab). The following macro will remove the carriage returns from all data entry formfields in the document. You could call it from each formfield as an on-exit macro, or from just one formfield (eg the last formfield to be filled in). Alternatively, you could intercept the document save/print routines. Sub FFClean_Up() Dim FrmFld FormField For Each FrmFld In ActiveDocument.FormFields If FrmFld.Type = wdFieldFormTextInput Then FrmFld.Result = Replace(FrmFld.Result, vbCr, "") Next End Sub You could also modify the code so that it removes the enter keys from nominated formfields only. To see how to make the enter key behave like the tab key, go to:http://support.microsoft.com/default.aspx/kb/211219 Cheers -- macropod [MVP - Microsoft Word] ------------------------- wrote in ... I a form is to possible to NOT allow multi-line input? As it is, a person CAN hit the return-key, even if you've specified a limited number of characters. If the return-key is hit, a 2nd line will appear, but it's not visible (if the row has a exact height, which is the case here). Regards, JeLa |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Merge Multi-line csv | Mailmerge | |||
Multi line Drop Down Form Field | Microsoft Word Help | |||
Can I have multi-line items in a drop down box? | Microsoft Word Help | |||
Merging multi-line fields | Mailmerge | |||
multi line TOC entry | Microsoft Word Help |