#1   Report Post  
Posted to microsoft.public.word.tables
Ray Dunn Ray Dunn is offline
external usenet poster
 
Posts: 5
Default Using Forms

How can I limit users from entering a new line in a form field? I have
limited the number of charaters, but after protection is applied the user
can still hit the enter key. I don't want to ruin the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro


  #2   Report Post  
Posted to microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Using Forms

Put the form field in a table cell with Exact row height. They'll still be
able to press Enter, but what they type will disappear. That's enough of a
clue for most users; if not, see “WD: How to Code ENTER Key to Move to Next
Field in Form” at http://support.microsoft.com?kbid=211219

--
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.

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I have
limited the number of charaters, but after protection is applied the user
can still hit the enter key. I don't want to ruin the spacing on the

page.
Thanks,
Ray
ps. Word 2003, win xp pro



  #3   Report Post  
Posted to microsoft.public.word.tables
Ray Dunn Ray Dunn is offline
external usenet poster
 
Posts: 5
Default Using Forms

Thanks Suzanne, but I do not want them to be able to enter a new line at
all. The progammable macro doesn't seem like it will work, due to the fact
that the form will be protected. The form must be protected. Any other
ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I have
limited the number of charaters, but after protection is applied the user
can still hit the enter key. I don't want to ruin the spacing on the
page.
Thanks,
Ray
ps. Word 2003, win xp pro



  #4   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using Forms

Hi Ray,

The macro *will* work -- it was developed specifically for use in protected
forms. However, it does assume that users are filling out the form on a
computer that has both the template (which must be unprotected) and the form
document based on the template. If you're sending the form through email,
this assumption is almost certainly false.

The method of setting an exact row height will prevent "ruining the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be transferred to
a database, or otherwise used in a context where the additional material
would show up.

There are no other alternatives that I'm aware of, unless you and all your
form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new line
at all. The progammable macro doesn't seem like it will work, due to
the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro



  #5   Report Post  
Posted to microsoft.public.word.tables
Ray Dunn Ray Dunn is offline
external usenet poster
 
Posts: 5
Default Using Forms

Jay,
Here is what I have. I am a high school teacher and I am having
students fill out information about themselves on a form that I have
created. I have 20 computers in my lab and a server. I do not want to
place the form on each computer, if I can help it. I planned on placing the
form on the server, where the student only has read rights. Once they type
their information, they print it and hand it in. There would be no
template, just the protected document in a read-only folder on the server.
Any ideas, will the macros still work?
Thanks,
Ray


"Jay Freedman" wrote in message
...
Hi Ray,

The macro *will* work -- it was developed specifically for use in
protected forms. However, it does assume that users are filling out the
form on a computer that has both the template (which must be unprotected)
and the form document based on the template. If you're sending the form
through email, this assumption is almost certainly false.

The method of setting an exact row height will prevent "ruining the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be transferred
to a database, or otherwise used in a context where the additional
material would show up.

There are no other alternatives that I'm aware of, unless you and all your
form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new line
at all. The progammable macro doesn't seem like it will work, due to
the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro







  #6   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using Forms

Yes, I believe it will work, with one small change.

The macros run when the template is used to create or open any document
based on that template, regardless of where the template's file is stored.

The change is needed because the template is in a read-only folder, so you
can't save it. The next-to-last line of the fourth macro should change from

Templates(1).Save

to

Templates(1).Saved = True

This "lies" to Word and tells it that there hasn't been any change in the
template, so it won't attempt to save it or prompt for a save.

Can you set up the template on the server and do a trial run on one or two
workstations before the term starts? That will either prove that it works or
show where the problem (if any) is. If you get an error message when you try
to close the form, remove the fourth macro from the template completely;
then you'll have to restart Word to restore the original function of the
Enter key.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Ray Dunn wrote:
Jay,
Here is what I have. I am a high school teacher and I am having
students fill out information about themselves on a form that I have
created. I have 20 computers in my lab and a server. I do not want
to place the form on each computer, if I can help it. I planned on
placing the form on the server, where the student only has read
rights. Once they type their information, they print it and hand it
in. There would be no template, just the protected document in a
read-only folder on the server. Any ideas, will the macros still
work? Thanks,
Ray


"Jay Freedman" wrote in message
...
Hi Ray,

The macro *will* work -- it was developed specifically for use in
protected forms. However, it does assume that users are filling out
the form on a computer that has both the template (which must be
unprotected) and the form document based on the template. If you're
sending the form through email, this assumption is almost certainly
false. The method of setting an exact row height will prevent "ruining
the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be
transferred to a database, or otherwise used in a context where the
additional material would show up.

There are no other alternatives that I'm aware of, unless you and
all your form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new
line at all. The progammable macro doesn't seem like it will work,
due to the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro



  #7   Report Post  
Posted to microsoft.public.word.tables
Ray Dunn Ray Dunn is offline
external usenet poster
 
Posts: 5
Default Using Forms

I don't seem to be having much luck. Do the macros supposed to run
automatically? All of the vba code has been entered and I have set my
security to low, but when I open the file I get "Sub or Function not
defined"

Ray

"Jay Freedman" wrote in message
...
Yes, I believe it will work, with one small change.

The macros run when the template is used to create or open any document
based on that template, regardless of where the template's file is stored.

The change is needed because the template is in a read-only folder, so you
can't save it. The next-to-last line of the fourth macro should change
from

Templates(1).Save

to

Templates(1).Saved = True

This "lies" to Word and tells it that there hasn't been any change in the
template, so it won't attempt to save it or prompt for a save.

Can you set up the template on the server and do a trial run on one or two
workstations before the term starts? That will either prove that it works
or show where the problem (if any) is. If you get an error message when
you try to close the form, remove the fourth macro from the template
completely; then you'll have to restart Word to restore the original
function of the Enter key.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.

Ray Dunn wrote:
Jay,
Here is what I have. I am a high school teacher and I am having
students fill out information about themselves on a form that I have
created. I have 20 computers in my lab and a server. I do not want
to place the form on each computer, if I can help it. I planned on
placing the form on the server, where the student only has read
rights. Once they type their information, they print it and hand it
in. There would be no template, just the protected document in a
read-only folder on the server. Any ideas, will the macros still
work? Thanks,
Ray


"Jay Freedman" wrote in message
...
Hi Ray,

The macro *will* work -- it was developed specifically for use in
protected forms. However, it does assume that users are filling out
the form on a computer that has both the template (which must be
unprotected) and the form document based on the template. If you're
sending the form through email, this assumption is almost certainly
false. The method of setting an exact row height will prevent "ruining
the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be
transferred to a database, or otherwise used in a context where the
additional material would show up.

There are no other alternatives that I'm aware of, unless you and
all your form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new
line at all. The progammable macro doesn't seem like it will work,
due to the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro





  #8   Report Post  
Posted to microsoft.public.word.tables
Ray Dunn Ray Dunn is offline
external usenet poster
 
Posts: 5
Default Using Forms

Now I get Run-time error '5980';
The context cannot be modified.
Ray

"Ray Dunn" wrote in message
...
I don't seem to be having much luck. Do the macros supposed to run
automatically? All of the vba code has been entered and I have set my
security to low, but when I open the file I get "Sub or Function not
defined"

Ray

"Jay Freedman" wrote in message
...
Yes, I believe it will work, with one small change.

The macros run when the template is used to create or open any document
based on that template, regardless of where the template's file is
stored.

The change is needed because the template is in a read-only folder, so
you can't save it. The next-to-last line of the fourth macro should
change from

Templates(1).Save

to

Templates(1).Saved = True

This "lies" to Word and tells it that there hasn't been any change in the
template, so it won't attempt to save it or prompt for a save.

Can you set up the template on the server and do a trial run on one or
two workstations before the term starts? That will either prove that it
works or show where the problem (if any) is. If you get an error message
when you try to close the form, remove the fourth macro from the template
completely; then you'll have to restart Word to restore the original
function of the Enter key.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.

Ray Dunn wrote:
Jay,
Here is what I have. I am a high school teacher and I am having
students fill out information about themselves on a form that I have
created. I have 20 computers in my lab and a server. I do not want
to place the form on each computer, if I can help it. I planned on
placing the form on the server, where the student only has read
rights. Once they type their information, they print it and hand it
in. There would be no template, just the protected document in a
read-only folder on the server. Any ideas, will the macros still
work? Thanks,
Ray


"Jay Freedman" wrote in message
...
Hi Ray,

The macro *will* work -- it was developed specifically for use in
protected forms. However, it does assume that users are filling out
the form on a computer that has both the template (which must be
unprotected) and the form document based on the template. If you're
sending the form through email, this assumption is almost certainly
false. The method of setting an exact row height will prevent "ruining
the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be
transferred to a database, or otherwise used in a context where the
additional material would show up.

There are no other alternatives that I'm aware of, unless you and
all your form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new
line at all. The progammable macro doesn't seem like it will work,
due to the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro







  #9   Report Post  
Posted to microsoft.public.word.tables
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using Forms

The answer to this problem is in the article
(http://support.microsoft.com/?kbid=211219) that contains the macros:

"IMPORTANT: For this code to work as written, the template should not
be protected. If the template is protected, you receive the following
error message:
The context cannot be modified."

Follow the steps listed immediately after that statement, to unprotect
the template and save it.

The AutoNew macro in the article contains a statement that protects
the new document for forms, while the template remains unprotected.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Tue, 29 Aug 2006 13:31:18 -0400, "Ray Dunn"
wrote:

Now I get Run-time error '5980';
The context cannot be modified.
Ray

"Ray Dunn" wrote in message
...
I don't seem to be having much luck. Do the macros supposed to run
automatically? All of the vba code has been entered and I have set my
security to low, but when I open the file I get "Sub or Function not
defined"

Ray

"Jay Freedman" wrote in message
...
Yes, I believe it will work, with one small change.

The macros run when the template is used to create or open any document
based on that template, regardless of where the template's file is
stored.

The change is needed because the template is in a read-only folder, so
you can't save it. The next-to-last line of the fourth macro should
change from

Templates(1).Save

to

Templates(1).Saved = True

This "lies" to Word and tells it that there hasn't been any change in the
template, so it won't attempt to save it or prompt for a save.

Can you set up the template on the server and do a trial run on one or
two workstations before the term starts? That will either prove that it
works or show where the problem (if any) is. If you get an error message
when you try to close the form, remove the fourth macro from the template
completely; then you'll have to restart Word to restore the original
function of the Enter key.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.

Ray Dunn wrote:
Jay,
Here is what I have. I am a high school teacher and I am having
students fill out information about themselves on a form that I have
created. I have 20 computers in my lab and a server. I do not want
to place the form on each computer, if I can help it. I planned on
placing the form on the server, where the student only has read
rights. Once they type their information, they print it and hand it
in. There would be no template, just the protected document in a
read-only folder on the server. Any ideas, will the macros still
work? Thanks,
Ray


"Jay Freedman" wrote in message
...
Hi Ray,

The macro *will* work -- it was developed specifically for use in
protected forms. However, it does assume that users are filling out
the form on a computer that has both the template (which must be
unprotected) and the form document based on the template. If you're
sending the form through email, this assumption is almost certainly
false. The method of setting an exact row height will prevent "ruining
the
spacing", if that's your only concern. The only time I'd worry about
newlines with this method is when the field contents will be
transferred to a database, or otherwise used in a context where the
additional material would show up.

There are no other alternatives that I'm aware of, unless you and
all your form recipients are using Word 2003.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Ray Dunn wrote:
Thanks Suzanne, but I do not want them to be able to enter a new
line at all. The progammable macro doesn't seem like it will work,
due to the fact that the form will be protected. The form must be
protected. Any other ideas?

Thanks again,
Ray

"Ray Dunn" wrote in message
...
How can I limit users from entering a new line in a form field? I
have limited the number of charaters, but after protection is
applied the user can still hit the enter key. I don't want to ruin
the spacing on the page.
Thanks,
Ray
ps. Word 2003, win xp pro





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
Single source-multiple forms ladygr Mailmerge 3 March 27th 06 12:07 AM
MS Word XP Forms Menu - Print Various Forms All At Once ~DLC~ Microsoft Word Help 2 February 21st 06 02:37 PM
Forms Development in Word Jugglertwo Microsoft Word Help 2 February 1st 06 05:36 PM
printing forms Kagiso Microsoft Word Help 2 December 14th 05 10:21 PM
printing only forms Kagiso Microsoft Word Help 1 December 14th 05 04:32 PM


All times are GMT +1. The time now is 11:54 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"