Asking a User for Text Input in Word 2007

Microsoft Word, Tips & Tricks Add comments

mswordtweak.pngWith many templates, the user is required to fill in certain document properties, such as the title, subject, author, or keywords. Ensuring that these values are entered can be a cru­cial part of a document management system. One way to do this is to use a Fill-in field, which displays a dialog box that prompts the user for data. The entered data is then dis­played as the field result:

{ FILLIN Prompt }

Prompt is the text that appears as a prompt in the dialog box. Here’s an example:

{ FILLIN “Please enter the document title:” }

If you insert this field in a template, Figure 1 shows the dialog box that appears when the user creates a new document based on the template.

When you update a Fill-infield, Word displays a dialog box sim­ilar to this one
Figure 1 When you update a Fill-infield, Word displays a dialog box sim­ilar to this one.

Although it may occasionally be useful to store user input in the document (this often hap­pens in mail merges, for example), what if what you really want to do is change the actual document properties? Because each document property has its own field type, you can change many properties by specifying the Fill-in result as the new property value. For example, the following code prompts the user for a document title and then stores the result in the Title property using the Title field:

{ TITLE { FILLIN “Please enter a document title:” } }

TIP

Unfortunately, the result of the Titlefield displays in the document text.To avoid this,you can hide the result by placing everything inside a Seqfield.You normally use this field to create a sequential numbering system, but it comes with a \hswitch that hides the field. Here’s the hidden form of the Fill-infield:
{ SEQ \h { TITLE { FILLIN “Please enter a document title:” } } }

TIP

If you’re not sure of the field name to use for a particular property, you can display a list of the vari­ous document property fields. Choose Insert, Quick Parts, Field to open the Field dialog box. In the Categories list,click Document Information.The Field Names list shows all the document property fields.

NOTE

Word also comes with an Ask field type.This works the same as Fill-in, except that the result is stored in a bookmark:
{ ASK Bookmark Prompt }

Technorati Tags: , ,

Popularity: 2% [?]

Related Post

  • Using an Input Mask to Ensure Consistent Data Entry in Access 2007
  • Allowing Only Certain Values in a Cell
  • Calculating Multiple Solutions to a Formula in Excel 2007
  • Using Dialog Box Controls to Input Data in Excel 2007
  • Locking Document Formatting in Word 2007
  • Don't Find What You're Looking For? Please Try Here...

    Google
     

    Leave a Reply

    WP Theme & Icons by N.Design Studio
    Entries RSS Comments RSS Add to Technorati Favorites Log in