Making Forms with Microsoft Word
VERY ROUGH DRAFT - not ready for prime time - this is in the site
right now only for the Additional Written Resources
by Charles Kyle Kenyon, Esq.
There are no expectations that this chapter will ever be of the same quality and
depth as the other chapters of this guide. That is because it was
written by a single author not working with Microsoft. I am not an
expert at this, I'm a lawyer with a passion for efficiency and
effectiveness. You will not find
this chapter on the Microsoft site. Comments are welcome.
You should have reviewed Basic
Formatting, Tables and the bookmarks and
cross-reference portions of Complex
Legal Documents before tackling this chapter.
Click here to break out of a frame.
What You Will Learn
After completing this lesson, you will be able to:
 | Create an online form to mimic a paper form. |
 | Create an online form to fill in a paper form. |
 | Create an online form to replace a paper form. |
 | Create an online form to prepare a draft legal document. |
 | Give the online form user help and on-screen hints. |
 | Use form fields restrict data entry. |
 | Protect a forms document from modification. |
 | Protect only part of a forms document from modification. |
 | Unlock and re-lock a forms document without resetting forms
fields. |
 | Spell Check a Protected Form. |
 | Put buttons on your form for your user that don't print out. |
 | Use MacroButton fields in
protected portions of your forms (to mimic hyperlinks, among other
things) |
Additional Written (and Web) Resources
 | Word
97 for Law Firms by Payne
Consulting Group. (also at Amazon.com
UK)
 | Word
2000 for Law Firms by Payne
Consulting Group. (also at Amazon.com
UK) |
 | Word
X (2002) for Law Firms by Payne
Consulting Group. (also at Amazon.com
UK) |
 | Please
Fill Out This Form 1 by Dian D. Chesney, MVP - Creating a Form |
 | Please
Fill Out This Form 2 by Dian D. Chesney, MVP - Automating the Form |
 | Creating
Automated Forms Using VBA by Greg B. Chapman, MVP |
 | How
to best create fill-in-the-blank lines on a form, Suzanne S.
Barnhill, MVP and David Rado, MVP |
 | Forms
FAQ by Cindy Meister, MVP |
 | How
to enable the spell-checker in a protected document, Dave Rado |
 | How
to hide a "Print" command button on a Form so that it
doesn't print by Ibby |
 | Bookmarks and Fields Sampler by Joseph
Freedman with additions from Charles Kenyon |
 | How
to change the action of the Enter key in forms (Microsoft Knowledge Base
Q187985) |
 | How
to validate the contents of a Word Form field by Dave Rado, MVP |
 | How
to set the "tab order" of a Word Form by Dave Rado, MVP and
Mark Tangard |
 | The
best way to select a form field using VBA by Mark Tangard |
 | Enable
a user to change a "Y" to an "N" and back by
double-clicking - by Bill Coan, MVP |
 | Why
Does the Appearance (or layout) of My Document Change When I Open It
On a Different Machine? Suzanne S. Barnhill, MVP |
 | How
to insert the filename and path on the last page of a document, such
that it will be updated automatically if the filename or path
changes by Bill Coan, MVP. |
 | Word
Bookmarks by Cindy Meister |
 | How
to find the name of the current formfield by Astrid Zeelenberg |
 | Microsoft Support - Forms |
 | Designing
On-Line Forms by Kathy Finder |
 | The
Forms Toolbar - Kathy Finder, University of Wisconsin - Eau
Claire |
 | Using
On-Line Forms - Kathy Finder, University of Wisconsin - Eau
Claire |
 | Working
with Form Fields - Kathy Finder, University of Wisconsin - Eau
Claire |
 | Microsoft Knowledge Base
 | Q212328
WD2000: How to Create an Online Form Using Form Fields |
 | Q212378
WD2000: How to Control the Tabbing Order in a Form |
 | Q212101
WD2000: Ampersand Is Displayed Incorrectly in Drop-Down List Box |
 | Q212080
WD2000: Length of Form Field Expands or Contracts, Affects
Alignment |
 | Q212356
WD2000: How to Update Fields in a Protected Form |
|
 | From
Word to ... (Getting Data out of Word, esp. Word Forms) by Cindy
Meister (Advanced) |
 | This
chapter in Word format (not yet). |
 | Sample Forms
 | Public Defender Payment Voucher - Summary cover sheet with
five time sheets. Extensive use of tables, cross-references,
calculated fields. (download
in zip format) |
 | Public Defender Transcript Request Form (based on printed form
- wild layout of fields using tables, some use of bookmarks, use
of exit macros to control tab order. (download
in zip format) |
|
|
Macro Package for Form Information Management
 
(this
guide table of contents) ------- (MS
Word New Users FAQ)
Forms Overview
What I am talking about in this chapter is what
is referred to as an online form in Microsoft’s documentation. Such
online forms can also be printed forms to be filled out by hand or on a
typewriter.
When used on the computer, they are generally templates
that create new documents. These documents are protected from changes in
crucial areas. This protection also allows use of special fields
inserted with the Forms Toolbar.
Starting from a Printed Form
In my practice, often a printed form will come in
that it would be helpful to be able to fill in using Microsoft Word.
This breaks down into
 | those forms that you want to be able to type and print in Word to
look as if they were typed on the actual paper form, |
 |
those forms that you want to be able to
type in Word and print to the actual paper form,
and |
 |
those forms
that you want to be able to type and print in Word to look
close to the paper form. |
Let’s take a look at each of these
possibilities in order.
Mimic forms
Getting a Word-printed form to look exactly like
the pre-printed form can be very difficult because the fonts and spacing
options are different. Probably the simplest way to mimic a paper form
is to scan it in a high-resolution scan (at least 600 dpi) and use that
as the basis for your document.
When you scan the document, clean it up in your
scanning program. That means remove any extra marks or things that
shouldn’t be on the form. Straighten the image up so that a horizontal
line drawn in Word is going to match a horizontal line on the form. Crop
off any extra margin area. Save the scanned image into your template’s
folder using a picture format that Word recognizes. I would suggest JPG,
PNG, or GIF. For purposes of this tutorial, let’s call your scanned
image “form.jpg.”
Open Word.
Format your margins to those of the printed form.
Switch to View Headers and Footers.
You are going to
import the form in your document’s header. Draw a text box in the
header that fills the entire page. (Insert | Text Box). Click
inside the textbox.
Insert your scanned image in the textbox. (Insert | Picture | From file)
(Select the option to “link” rather than insert or insert and link.)
Right-click on the image and select Format
Picture.

Click on the Size tab and make sure your size
scale is 100%. Word will likely have inserted at 97% or something close
but not at the 100% that you need. Close the Format Picture box by
clicking on OK.
Move your pointer to the edge of your text-box
and right-click on the text-box border. Select “Format Text Box”
from the short-cut menu.
Change the options
under Fill to “No Fill” and Line to “No Line.”

Click on the
Layout tab and then click on the box that says “Behind text.”

Click on the
“Advanced” button and on the Position Tab click in the “Absolute
position” radio buttons and select “from page” as the reference
for both vertical and horizontal spacing. Uncheck the box that says
“Move object with text” and check the box that says “Lock
anchor.”

Starting from Scratch
Locking and Unlocking Forms
Spell-Checking Forms
Printed Forms
Word Help topics:
Word 2000
·
Create a Form
·
Overview of Forms
Word 97
·
Create an online form
WD97: How to Code the ENTER Key to Move to Next Field in
Protected Form
|

The information in this article applies to:
 | Microsoft Word 97 for Windows |

SUMMARY
This article contains four Visual Basic for Applications macros that
you can use to emulate the Microsoft Word 6.0 for Windows functionality
of the ENTER key for moving between form fields in protected documents.
In Microsoft Word 6.0 for Windows, if you press the ENTER key in a
document protected for forms, the insertion point moves to the next form
field. By contrast, in later versions of Word, the ENTER key does not
move to the next form field but instead inserts a paragraph mark, just
as it would in an unprotected document. This allows you to enter
multiple lines of text into a text form field.
MORE INFORMATION
Microsoft provides programming examples for illustration only,
without warranty either expressed or implied, including, but not limited
to, the implied warranties of merchantability and/or fitness for a
particular purpose. This article assumes that you are familiar with the
programming language being demonstrated and the tools used to create and
debug procedures. Microsoft support professionals can help explain the
functionality of a particular procedure, but they will not modify these
examples to provide added functionality or construct procedures to meet
your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Solution Provider or the Microsoft
fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on
the World Wide Web:
http://mcspreferral.microsoft.com/
For more information about the support options available from Microsoft,
please see the following page on the World Wide Web:
http://support.microsoft.com/directory/overview.asp
What follows are the four Visual Basic for Applications macros that you
can use together to emulate the Microsoft Word 6.0 for Windows
functionality of the ENTER key in new protected form field documents
based on a template.
For this code to work as written, the template should not be protected.
The first macro moves the insertion point to the next form field. The
second macro assigns the first macro to the ENTER key. The third macro
adds an AutoOpen macro to the ENTER key. The fourth macro removes the
assigned macro to the ENTER key, restoring the default functionality of
the ENTER key.
First Macro: Moves the Insertion Point to the Next Form Field
This macro moves the insertion point to the next form field. If the
current form field is the last one in the document, it moves the
insertion point to the first form field.
This macro uses the Bookmarks collection to retrieve the name of the
current form field. The name of each form field is also the name of a
bookmark inserted for the form field. If you have any other bookmarks in
your document, you may have to add more code here to handle potential
errors. The macro also assumes that all form fields in the documents
allow user input. If this is not the case in your document, you will
have to add additional code in your macro.
The macro checks whether the current section is protected or
unprotected, and then either moves to the next form field (in a
protected section) or inserts a paragraph mark (in an unprotected
section). This functionality is necessary for documents that contain
both sections that are protected for form input and for unprotected
sections. 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
' Retrieve the bookmark of the current selection.
' This is equivalent to the name of the form field.
myformfield = Selection.Bookmarks(1).Name
' Go to the next form field if the current form field
' is not the last one in the document.
If ActiveDocument.FormFields(myformfield).Name <> _
ActiveDocument.FormFields(ActiveDocument.FormFields.Count) _
.Name Then
ActiveDocument.FormFields(myformfield).Next.Select
Else
' If the current form field is the last one,
' go to the first form field in the document.
ActiveDocument.FormFields(1).Select
End If
Else
' If the document is not protected for forms,
' insert a tab stop character.
Selection.TypeText Chr(13)
End If
End Sub
Second Macro: Assigns the EnterkeyMacro Macro to the ENTER Key
This macro attaches the EnterKeyMacro macro to the ENTER key, thereby
reprogramming the function of the key when it is used in protected
document form fields. When you use this macro in a custom template, name
it "AutoNew" (without the quotation marks). This will change
the functionality of the ENTER key in all new form documents based on
the template. Sub AutoNew()
' Do Not protect the template containing these macros.
CustomizationContext = ActiveDocument.AttachedTemplate
' Bind the ENTER key to the EnterKeyMacro.
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyReturn), _
KeyCategory:=wdKeyCategoryMacro, Command:="EnterKeyMacro"
' Reprotect the document with Forms protection.
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
Third Macro: Adds an AutoOpen Macro to the ENTER Key
Add an AutoOpen macro with the following code. This ensures that the key
functionality will continue when you open a document based on the form
template in the future. 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.Add KeyCode:=BuildKeyCode(wdKeyReturn), _
KeyCategory:=wdKeyCategoryMacro, Command:="EnterKeyMacro"
End Sub
NOTE: Running these macros may disable some functions, such as
AutoCorrect and AutoText, and may affect other features that depend on
the ENTER key for proper operation. You need to run the forth macro to
restore the default functionality of the ENTER key or restart Microsoft
Word.
Fourth Macro: Removes the Command Assigned to the ENTER Key
This macro restores the default functionality of the ENTER key. When you
use this macro in a custom template, name it AutoClose. Sub AutoClose()
CustomizationContext = ActiveDocument.AttachedTemplate
FindKey(KeyCode:=BuildKeyCode(wdKeyReturn)).Disable
' Disables prompt to save template changes.
Templates(1).Save
End Sub
NOTE: The CustomizationContext property sets the location where the
keyboard customization is to be saved, in this case the template
attached to the active document.
For additional information, please see the following article in the
Microsoft Knowledge Base:
Q173707
OFF97: How to Run Sample Code from Knowledge Base Articles
REFERENCES
For more information about getting help with Visual Basic for
Applications, please see the following article in the Microsoft
Knowledge Base:
Q163435
VBA: Programming Resources for Visual Basic for Applications
Create a Form to Protect Information and Allow User Input
Do you ever want people to enter information in a document and, at
the same time, prevent them from changing certain information? An easy
solution is to create a form in Microsoft Word 2000. A form allows users
to enter information, while it prevents unauthorized persons from
changing the form.
Create a form with a table
It's simple to create a form in Word 2000. You can use a table to lay
out the form and then enter form fields in the cells where you
want information entered or updated. A form field can be a Text Form
Field, a Check Box Form Field, or a Drop-down Form Field.
Text form fields are used when you want the user to enter information,
such as names and addresses. The check box and drop-down form fields
allow users to select items that are on the form.
Step 1 - Create a table
- On the View menu, point to Toolbars, and then select
Forms.
- On the Forms toolbar, click Insert Table.
- On the table that appears, drag your mouse to select the number of
rows and columns you want.
- Adjust the columns to the appropriate widths.
Step 2 - Create a form
- In the first row of your table, enter a heading (a field label) in
each column.
- In the row under each column, click the place where you want users
to enter information.
- On the Forms toolbar, do one of the following:
| To |
Do this |
Enter a Text Form Field
|
Click Text Form Field. |
| Enter a Drop-Down Form Field |
Click Drop-Down Form Field. |
| Enter a Check Box Form Field |
Click Check Box Form Field. |
Double-click each blank field that appears in the table.
In the dialog box for each form field, do one of the following:
| For |
Do this |
| A Text Form Field |
- Under Type, select the appropriate
information type to be entered in the field.
- Under Default text, enter text that you want to
appear in the field.
- Under Maximum length, define the maximum size
of the field.
|
| A Drop-Down Form Field |
- In the Drop-down item box, type an item you
want to appear in the list box, and then click Add.
- Repeat step 1 until you have entered all the items.
- Use the Move up and down arrows to list the
items in the order you choose.
|
| A Check Box Form Field |
- If you want the check box to be a certain size, under Check
box size, click Exactly, and then select a
size. The default is Auto.
- If you want the box to be checked, under Default
value, select Checked. The default is Not
checked.
|
Step 3 - Protect the document
Before you distribute the form, you need to protect the document.
- On the Tools menu, click Protect Document.
- Under Protect document for, click Forms.
If you created sections in your document, click Sections to
specify which sections you want to protect. For example, you might
want to create separate sections for a table with data that users
cannot modify and a table in which users can enter data.
- If you want others to be able to change the form, under Password,
enter a password that you share with users who are authorized to
change the form.
To quickly protect your form
 | On the Forms toolbar, click Protect Form. |
For more information about creating forms, type create a form
in the Office Assistant or on the Answer Wizard tab in the Word
Help window, and then click Search. For information on creating
sections, type insert sections in the Office Assistant or on the Answer
Wizard tab in the Word Help window, and then click Search.
from http://officeupdate.microsoft.com/2000/articles/wCreateForms.htm
Troubleshooting Forms — Issues To Watch Out For
Q212328
WD2000: How to Create an Online Form Using Form Fields
Q212378
WD2000: How to Control the Tabbing Order in a Form
Q212101
WD2000: Ampersand Is Displayed Incorrectly in Drop-Down List Box
Q212080
WD2000: Length of Form Field Expands or Contracts, Affects
Alignment
Q212356
WD2000: How to Update Fields in a Protected Form
|
.
|