A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using Forms



 
 
Thread Tools Display Modes
  #1  
Old August 29th, 2006, 02:17 PM posted to microsoft.public.word.tables
Ray Dunn
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  
Old August 29th, 2006, 02:35 PM posted to microsoft.public.word.tables
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
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  
Old August 29th, 2006, 03:28 PM posted to microsoft.public.word.tables
Ray Dunn
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  
Old August 29th, 2006, 03:48 PM posted to microsoft.public.word.tables
Jay Freedman
external usenet poster
 
Posts: 9,488
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  
Old August 29th, 2006, 03:58 PM posted to microsoft.public.word.tables
Ray Dunn
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  
Old August 29th, 2006, 05:06 PM posted to microsoft.public.word.tables
Jay Freedman
external usenet poster
 
Posts: 9,488
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  
Old August 29th, 2006, 06:02 PM posted to microsoft.public.word.tables
Ray Dunn
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  
Old August 29th, 2006, 06:31 PM posted to microsoft.public.word.tables
Ray Dunn
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  
Old August 30th, 2006, 03:31 AM posted to microsoft.public.word.tables
Jay Freedman
external usenet poster
 
Posts: 9,488
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





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.