#1   Report Post  
Posted to microsoft.public.word.docmanagement
Robert Heintz
 
Posts: n/a
Default Form fields

I added the KB macros to my form and it did work, except that the formatting
of the field was not carried out (i.e. with format set to MM/dd/yy, input 5/4
and field showed 5/4 instead of 05/04/06) when using the enter key. I found
that by using the command SendKeys "{TAB}" the fields woud be formatted.
Also, did not have to check if was last field to go first field.

Here is the code.

Sub EnterKeyMacro()
' Check whether the document is protected for forms
' and whether the protection is active.
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields And _
Selection.Sections(1).ProtectedForForms = True Then
' Go to the next form field if the current form field
SendKeys "{TAB}"
Else
' If the document is not protected for forms,
' insert a tab stop character.
Selection.TypeText Chr(13)
End If
End Sub


"Peter B" wrote:

Is there a way to limit a form field to 1 line only so when the enter key is
used to navigate round the form instead of the tab key another line is not
added? I have some fields that cannot be limited to a set sum of characters,
e.g names, and want to stop extra lines being added.

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
Blank return for drop-down form fields Peter B. Microsoft Word Help 4 January 26th 07 05:01 PM
Form text fields are disappearing during a merge to new document. Trevor Drew Mailmerge 7 January 30th 06 09:35 PM
Default text shown in form fields Gitte Microsoft Word Help 1 January 2nd 06 03:16 PM
How do I use a form then mailmerge without losing the form fields Someone who's stuck Mailmerge 1 June 23rd 05 10:01 AM
Having multiple form fields automatically updated jrwaguespack Microsoft Word Help 3 March 25th 05 07:43 AM


All times are GMT +1. The time now is 03:49 AM.

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"