#1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] jsnlfromthenl@gmail.com is offline
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] jsnlfromthenl@gmail.com is offline
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Helmut Weber[_2_] Helmut Weber[_2_] is offline
external usenet poster
 
Posts: 45
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Multi-line csv David J Mailmerge 4 November 3rd 08 07:01 PM
Multi line Drop Down Form Field jmcole Microsoft Word Help 4 June 17th 06 05:38 AM
Can I have multi-line items in a drop down box? blue dog Microsoft Word Help 3 September 2nd 05 08:43 PM
Merging multi-line fields Matthew Hustings Mailmerge 1 May 18th 05 03:07 PM
multi line TOC entry OBH Microsoft Word Help 1 February 21st 05 06:38 PM


All times are GMT +1. The time now is 01:41 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"