Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORD VBA- copying text from first into all others

Status
Not open for further replies.

Toby1kenobe

Instructor
May 26, 2002
66
GB
Hi All

I've built up a form containing a textbox areas. On each of the 12 pages(all almost the same) is a "Student Name". Instead of updating this on each page i want this to be automated.

In the properties of the first textbox (bookmark "Name1") i put a macro into the on Exit event. However in my macro assigned to this event i cant do this

Name1 = name2
name1 = name3

etc.

I thought i got close with

thisDocument.bookmarks ("Name2").range.text = ThisDocument.bookmarks ("Name1").range.text

but it didnt work

Any help is always greatly appreciated

Toby Hodkinson
 
Hi Toby,

Why not use REF fields in your document to point to the bookmarks being created via your text boxes eg {REF Name1}. Then, once your bookmarks are populated, all you need to do is to execute:
ActiveDocument.Fields.Update
to update all the REF fields in the body of the document.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top