Reply
 
Thread Tools Display Modes
  #1   Report Post  
daveocampo
 
Posts: n/a
Default Is there a way to disable the Enter key in a Word template Form Fi

Hi,

I created a Word document template (.dot) with Form Fields, then I saved the
template in Protected mode and restrict the user to only allow Filling-In the
Forms Fields; however, if the user hits the Enter key, the form will generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field? If
not, maybe MS Offfice Development Team can add this feature to the Form Field
Propeties dialog box. Thanks!

David
  #2   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I saved

the
template in Protected mode and restrict the user to only allow Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David


  #3   Report Post  
daveocampo
 
Posts: n/a
Default

Dear Suzanne,

Thank you for the macro. It works great except there is a bug report.

After exiting the template in Word 2000, the following Microsoft Visual
Basic runtime error box appears:

Run-time error '5980':

The context cannot be modified.

If you click on the "Debug" button it yellow highlights the macro script for
macro #4, the "AutoClose" macro:

FindKey (KeyCode:=BuildKeyCode(wdKeyReturn)).Disable

The other option is to click the "End" button.

Thanks for your help!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I saved

the
template in Protected mode and restrict the user to only allow Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David



  #4   Report Post  
daveocampo
 
Posts: n/a
Default

Dear Suzanne,

I was able to resolve the "bug" issue. It appears the bug was just in the
first template I created which ran the macro. It is working fine now.
Thanks!!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I saved

the
template in Protected mode and restrict the user to only allow Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David



  #5   Report Post  
daveocampo
 
Posts: n/a
Default

Hello Suzanne,

One follow-up question: I added the macro to my document and then saved it
as a template document. The macro works perfectly. This form I created will
be used by employees outside my organization. It is a standardized form so I
don't want them adding extra lines of text or exceeding the form field length
properties. The macro prevents all of these issues, provided the user
ENABLES the macro. The downside is the user has the option to DISABLE the
macro as part of Microsoft's virus macro security warning. Is there a way to
include in the template an "abort the session" macro if the user selects to
disable the EnterKey macro? Thanks!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I saved

the
template in Protected mode and restrict the user to only allow Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David





  #6   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

If a user disables macros, then I don't imagine there's any way for ANY
macro to run. You might be better off just using an Exact row height
instead.

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

"daveocampo" wrote in message
...
Hello Suzanne,

One follow-up question: I added the macro to my document and then saved

it
as a template document. The macro works perfectly. This form I created

will
be used by employees outside my organization. It is a standardized form

so I
don't want them adding extra lines of text or exceeding the form field

length
properties. The macro prevents all of these issues, provided the user
ENABLES the macro. The downside is the user has the option to DISABLE the
macro as part of Microsoft's virus macro security warning. Is there a way

to
include in the template an "abort the session" macro if the user selects

to
disable the EnterKey macro? Thanks!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I

saved
the
template in Protected mode and restrict the user to only allow

Filling-In
the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there

a
macro or function in Word to disable the Enter key in a .dot form

field?
If
not, maybe MS Offfice Development Team can add this feature to the

Form
Field
Propeties dialog box. Thanks!

David




  #7   Report Post  
Charles Kenyon
 
Posts: n/a
Default

One level of protection would be to have the new document blank unless
macros are enabled. You use an AutoNew macro to actually create the form
(possibly from an AutoText entry). You could have a message display in the
no macros enabled version of the form that says it will not work unless
macros are enabled.

This is easy to get around or defeat but will work for most users.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"daveocampo" wrote in message
...
Hello Suzanne,

One follow-up question: I added the macro to my document and then saved
it
as a template document. The macro works perfectly. This form I created
will
be used by employees outside my organization. It is a standardized form
so I
don't want them adding extra lines of text or exceeding the form field
length
properties. The macro prevents all of these issues, provided the user
ENABLES the macro. The downside is the user has the option to DISABLE the
macro as part of Microsoft's virus macro security warning. Is there a way
to
include in the template an "abort the session" macro if the user selects
to
disable the EnterKey macro? Thanks!

Dave

"Suzanne S. Barnhill" wrote:

See "WD: How to Code ENTER Key to Move to Next Field in Form"
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I
saved

the
template in Protected mode and restrict the user to only allow
Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there
a
macro or function in Word to disable the Enter key in a .dot form
field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David





  #8   Report Post  
daveocampo
 
Posts: n/a
Default

Thank you Suzanne.

"Suzanne S. Barnhill" wrote:

If a user disables macros, then I don't imagine there's any way for ANY
macro to run. You might be better off just using an Exact row height
instead.

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

"daveocampo" wrote in message
...
Hello Suzanne,

One follow-up question: I added the macro to my document and then saved

it
as a template document. The macro works perfectly. This form I created

will
be used by employees outside my organization. It is a standardized form

so I
don't want them adding extra lines of text or exceeding the form field

length
properties. The macro prevents all of these issues, provided the user
ENABLES the macro. The downside is the user has the option to DISABLE the
macro as part of Microsoft's virus macro security warning. Is there a way

to
include in the template an "abort the session" macro if the user selects

to
disable the EnterKey macro? Thanks!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I

saved
the
template in Protected mode and restrict the user to only allow

Filling-In
the
Forms Fields; however, if the user hits the Enter key, the form will
generate
a line break and distort the standardized document template. Is there

a
macro or function in Word to disable the Enter key in a .dot form

field?
If
not, maybe MS Offfice Development Team can add this feature to the

Form
Field
Propeties dialog box. Thanks!

David




  #9   Report Post  
daveocampo
 
Posts: n/a
Default

Thank you Charles.

"Charles Kenyon" wrote:

One level of protection would be to have the new document blank unless
macros are enabled. You use an AutoNew macro to actually create the form
(possibly from an AutoText entry). You could have a message display in the
no macros enabled version of the form that says it will not work unless
macros are enabled.

This is easy to get around or defeat but will work for most users.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"daveocampo" wrote in message
...
Hello Suzanne,

One follow-up question: I added the macro to my document and then saved
it
as a template document. The macro works perfectly. This form I created
will
be used by employees outside my organization. It is a standardized form
so I
don't want them adding extra lines of text or exceeding the form field
length
properties. The macro prevents all of these issues, provided the user
ENABLES the macro. The downside is the user has the option to DISABLE the
macro as part of Microsoft's virus macro security warning. Is there a way
to
include in the template an "abort the session" macro if the user selects
to
disable the EnterKey macro? Thanks!

Dave

"Suzanne S. Barnhill" wrote:

See "WD: How to Code ENTER Key to Move to Next Field in Form"
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I
saved
the
template in Protected mode and restrict the user to only allow
Filling-In
the
Forms Fields; however, if the user hits the Enter key, the form will
generate
a line break and distort the standardized document template. Is there
a
macro or function in Word to disable the Enter key in a .dot form
field?
If
not, maybe MS Offfice Development Team can add this feature to the Form
Field
Propeties dialog box. Thanks!

David





  #10   Report Post  
ClassyIrish
 
Posts: n/a
Default

Hi, I have followed all of the above, I have office 2003, this macro isn't
working, or I am not doing something correct. In the text form field, I am
selecting the second macro on entering and exiting. Do I need all four of
the macros? Or should I just go to 6.0 where it was 'just there'? I am
frustrated because of the concern that when hitting the enter key it gives a
line break and messes with the original form, I just want it to be easy, and
it doesn't seem to be. Any help would be so greatly appreciated.

Thanks
Marguerite

"daveocampo" wrote:

Hi,

I created a Word document template (.dot) with Form Fields, then I saved the
template in Protected mode and restrict the user to only allow Filling-In the
Forms Fields; however, if the user hits the Enter key, the form will generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field? If
not, maybe MS Offfice Development Team can add this feature to the Form Field
Propeties dialog box. Thanks!

David



  #11   Report Post  
Doug Robbins
 
Posts: n/a
Default

Are you referring to

WD97: How to Code the ENTER Key to Move to Next Field in Protected Form
http://support.microsoft.com/support.../Q187/9/85.ASP


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ClassyIrish" wrote in message
...
Hi, I have followed all of the above, I have office 2003, this macro isn't
working, or I am not doing something correct. In the text form field, I
am
selecting the second macro on entering and exiting. Do I need all four of
the macros? Or should I just go to 6.0 where it was 'just there'? I am
frustrated because of the concern that when hitting the enter key it gives
a
line break and messes with the original form, I just want it to be easy,
and
it doesn't seem to be. Any help would be so greatly appreciated.

Thanks
Marguerite

"daveocampo" wrote:

Hi,

I created a Word document template (.dot) with Form Fields, then I saved
the
template in Protected mode and restrict the user to only allow Filling-In
the
Forms Fields; however, if the user hits the Enter key, the form will
generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?
If
not, maybe MS Offfice Development Team can add this feature to the Form
Field
Propeties dialog box. Thanks!

David



  #12   Report Post  
ClassyIrish
 
Posts: n/a
Default

Yes, Doug, I am. I am on a deadline, and thought I was pretty good at this,
but finding out I am not. Any help would be appreciated. I not only do not
want line breaks, but I have inserted text boxes with a text link so that if
more information is typed than there is room for in the text box, it will
flow over to another page. Works, UNTIL I protect the form, then you can't
even get into the darn text box to type.

"Doug Robbins" wrote:

Are you referring to

WD97: How to Code the ENTER Key to Move to Next Field in Protected Form
http://support.microsoft.com/support.../Q187/9/85.ASP


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ClassyIrish" wrote in message
...
Hi, I have followed all of the above, I have office 2003, this macro isn't
working, or I am not doing something correct. In the text form field, I
am
selecting the second macro on entering and exiting. Do I need all four of
the macros? Or should I just go to 6.0 where it was 'just there'? I am
frustrated because of the concern that when hitting the enter key it gives
a
line break and messes with the original form, I just want it to be easy,
and
it doesn't seem to be. Any help would be so greatly appreciated.

Thanks
Marguerite

"daveocampo" wrote:

Hi,

I created a Word document template (.dot) with Form Fields, then I saved
the
template in Protected mode and restrict the user to only allow Filling-In
the
Forms Fields; however, if the user hits the Enter key, the form will
generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?
If
not, maybe MS Offfice Development Team can add this feature to the Form
Field
Propeties dialog box. Thanks!

David




  #13   Report Post  
margaritta1601 margaritta1601 is offline
Junior Member
 
Posts: 2
Smile

Hi Dave,

I was wondering how you solve the "bug" issue... This is really frustrating... Please help!

The Macro works well until I password protect my form... that's when the Runtime error 5980 shows up!

Thank you in advance for any light!...

Marg

Quote:
Originally Posted by daveocampo View Post
Dear Suzanne,

I was able to resolve the "bug" issue. It appears the bug was just in the
first template I created which ran the macro. It is working fine now.
Thanks!!

Dave

"Suzanne S. Barnhill" wrote:

See €œWD: How to Code ENTER Key to Move to Next Field in Form€
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.

"daveocampo" wrote in message
...
Hi,

I created a Word document template (.dot) with Form Fields, then I saved

the
template in Protected mode and restrict the user to only allow Filling-In

the
Forms Fields; however, if the user hits the Enter key, the form will

generate
a line break and distort the standardized document template. Is there a
macro or function in Word to disable the Enter key in a .dot form field?

If
not, maybe MS Offfice Development Team can add this feature to the Form

Field
Propeties dialog box. Thanks!

David


  #14   Report Post  
margaritta1601 margaritta1601 is offline
Junior Member
 
Posts: 2
Smile

Fixed the Run-time error 5980!! (Or at least I think I did!)

I'm using Word2003 on XP, therefore I had to tweak the AutoOpen and AutoClose macros in order for it to work as it should without popping any bug report! Nop, it doesn't give me any Run-time error 5980 anymore! YAY!

Sharing the codes below... Please note I was just a lucky beginner! Good Luck!

Sub AutoOpen()
' This macro will reassign the ENTER key when you open an existing
' Word form fields document.
CustomizationContext = ActiveDocument.AttachedTemplate
' Bind the Enter key to the EnterKeyMacro.
KeyBindings.Key BuildKeyCode(wdKeyReturn)
End Sub


Sub AutoClose()
CustomizationContext = ActiveDocument.AttachedTemplate
FindKey(KeyCode:=BuildKeyCode(wdKeyReturn)).Execut e
' Disables prompt to save template changes.
Templates(1).Save
End Sub

Margaritta

Quote:
Originally Posted by margaritta1601 View Post
Hi Dave,

I was wondering how you solve the "bug" issue... This is really frustrating... Please help!

The Macro works well until I password protect my form... that's when the Runtime error 5980 shows up!

Thank you in advance for any light!...

Marg
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
The WordPerfect "Reveal Codes" method is so much easier to use. Torden Microsoft Word Help 8 April 19th 10 07:50 PM
Making Word do something that Wordperfect can do NarniaUK New Users 4 May 1st 05 10:44 PM
WordPerfect keyboard macro>Word equivalent? Anty New Users 2 March 13th 05 07:23 PM
letters - ask/fillin Caroline H New Users 2 February 25th 05 09:19 PM
how can you create quickwords in MS Office Word 2003 Christine S Microsoft Word Help 4 February 8th 05 04:01 PM


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