Creating a form field to be filled out by a user and populate through out the document

Anonymous
2015-03-01T18:08:02+00:00

I know this is simple but I cannot figure it out.

Working in

|Office 2013

 |Microsoft Office Word

 |Office for Windows 8.1

Please don't reference Greg Massey, I can't understand anything there and his tutorials seem completely out of whack with Word 2013.

I am building a contract where field are repeated several times, (FirstName, LastName, Address, etc.)

I want to create a field in the contract that populated throughout the document with these variable from the first field I population:

I want to enter the information each time from a template directly on the template. When a user would get to the template the first page might have something like this. There they would fill in the variables in italics

This contract is for FirstName LastName at ThisAddress, ThisCity, ThisZipCode

Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here. 

Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here.  Static content continues here. 

Then one of the variable above is needed again.  If it was entered above, it would automatically populate the fields filled in above.

FirstName LastName promises to pay $1 for services.

All Service are performed in ZipCode

I know you can do this with bookmarks, but when I did that, and then wanted to CHANGE the variable to make a contract with another person, I had to recreate the bookmark and all referenced fields on the whole thing from an original bookmark again.  I want to make this once, and the use just enters the basic information one time and it autopopulates the rest of the doc.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Doug Robbins - MVP - Office Apps and Services 323.6K Reputation points MVP Volunteer Moderator
2015-03-02T05:53:50+00:00

It is NOT to the default text that you create the cross reference, but to the bookmark that is assigned to the FormField.  

It is a good idea to assign a meaningful bookmark name to the formfield and in the example below, I have used TenantName as the bookmark as well as setting that as the default text.   Note that I have also checked the Calculate on Exit box

Then, after setting cross references to the Text of the Bookmark and Protecting the document for Filling in Forms, when I enter "Bill Smith" into the FormField

and then press the tab key, this will be the result

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments
Answer accepted by question author
John Korchok 236.2K Reputation points Volunteer Moderator
2015-03-02T14:44:28+00:00

Hi Davyd,

Legacy Form Fields will not relay the information until you protect the document for Filling in forms.

  1. Developer>Restrict Editing
  2. Editing Restrictions>Check Allow only this type of editing in the document.
  3. Set the dropdown to Filling in forms
  4. Click on Yes, Start Enforcing Protection
  5. Save your document.

Was this answer helpful?

0 comments No comments

46 additional answers

Sort by: Newest
  1. John Korchok 236.2K Reputation points Volunteer Moderator
    2015-03-02T00:26:55+00:00

    Hi, I'm very sorry to cause you confusion. You're 99% of the way there.

    We began by discussing Content Controls. For them, you need to use No changes (Read only) when protecting the form. 

    Later, when it became clear that it was important to be able to update the fields, I included Form Fields in the discussion. When you use form fields, you must use Filling in forms as the protection method.

    As Doug points out in his reply, you can avoid the macros and instead check the property in each form field to Calculate on exit and it will have the same effect of updating the fields.

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.6K Reputation points MVP Volunteer Moderator
    2015-03-01T23:56:53+00:00

    John,

    If Legacy FormFields are used, all that is necessary is to check the "Calculate on Exit" box for the FormFields that contain the information that is to be display elsewhere in the document (by means of a cross reference to the bookmark of the FormField.

    It is NOT necessary to use a macro, which can be an issue if the documents are distributed to others and the macros are disabled by their security settings.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-03-01T23:54:37+00:00

    John, you have been very helpful.  I really appreciate your help.  I swear I followed your instructions exactly. I am still failing to make this function correctly.  I am putting my actions inside your instructions below in Bold so you can easily see what I did.

    Here's how to create the macro:

    1. On the Developer tab, click on Macros. The Macros dialog opens.
    2. In the Macro Name field, type UpdateRefFields, then click on Create.
    3. In between the Sub and End Sub lines, type ActiveDocument.Fields.Update. Ensure that the line does not start with a single quote mark: that turns it into a comment that will not run. Your final macro should look something like this:

    Sub UpdateRefFields()

      ActiveDocument.Fields.Update

    End Sub

    Mine Looks like this:

    ---

    Sub UpdateRefFields()

    '

    ' UpdateRefFields Macro

    '

    '

    ActiveDocument.Fields.Update


    End Sub

    ---

    Created a text form field from legacy Forms - ****


    Type Regular Text

    Default text - left blank

    Max Length - unlimited

    Test Format left blank

    Entry left blank

    Exit chose UpdateRefFields

    Bookmark renamed TenantName

    Fill-in enabled - checked (it was checked)

    Calculate on exit left blank

    Now leave the VBA editor and return to your main document window. Follow these steps:

    1. With document protection turned off, right-click on a form field ( [FORMTEXT] aka TenantName ) and choose Properties
    2. Under Run macro on, click on the Exit dropdown and select UpdateRefFields. OK Out.
    3. Repeat for all  text form fields that relay data to a Ref field.
    4. Apply protection for Filling in Forms and save your document.

    Went to the Restrict editing DEVELOPER->Restrict Editing

    IN “Editing restriction” Checked “Allow only this type of editing in the document. “

    Chose “No Changes (Read Only)

    In “Exceptions” clicked on the [FORMTEXT] field (TenantName) and checked “Everyone”.

    Made sure that this was not clicked in the REF TenantName QuickPart

    Clicked Yes, Start Enforcing Protection.

    As you tab through the form fields, the Ref fields will automatically be updated.


    I only have two fields, the original test form field for a use to fill in and a single reference. I am doing something wrong and I cannot imagine what I am missing.


    Davydß-This BookMark is “TenantName” when I right click on properties to check

    TenantName

    Was this answer helpful?

    0 comments No comments