Solved

Text Box Auto Copy to Another

Posted on 2006-06-21
1
355 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically. To use this feature for other documents there are two steps involved,   1.  Prepare your document for a table of contents (he…
Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now