Solved

Text Box Auto Copy to Another

Posted on 2006-06-21
1
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
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…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

728 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