Solved

Text Box Auto Copy to Another

Posted on 2006-06-21
1
361 Views
Last Modified: 2008-02-01
Hello,

I am having trouble figuring out how a Word macro/subroutine/or other method can copy a value from one text box filled in on a form to another text box on same form.

I need the user to fill in his name on page one of a form and then have that name apear in another text box on page two automaticaly.

I have Googled this to death, but to no avail.

Thanks in advance.

0
Comment
Question by:kchrisc
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 100 total points
ID: 16955923
Since you mention a form, I presume that you are talking about text form fields, as opposed to a text box from the Insert menu.

This macro will copy from one text form field (Text1) to another (Text2).

Sub CopyTextBox()
    ActiveDocument.FormFields("Text2").Result = ActiveDocument.FormFields("Text1").Result
End Sub

Create the macro, then make it the Exit macro in the first form field.


Note that if there is no need to edit the repeated information, you could replace the second field with a Ref field using the name of the first form field. If you display the field codes, it will look like this.

{ Ref Text1 }

Tick 'Calculate on exit' in the form field's options(properties) window to ensure that the Ref field is updated immediately.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question