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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2010 populate common text upon opening 1

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
0
0
GB
I did this many years ago in Word 2003 probably but can't remember what it is called or how to do it.

What I have is a document that is 12 pages long. This document will be used many times by the company but certain elements will be changed each time. It is like

Blah blah blah blah [department name] blah blah blah blah blah blah blah blah blah [department name] blah blah blah blah blah blah [department name] blah blah blah blah blah blah [price] blah blah blah blah blah blah blah blah blah [department name]

At the moment they have to find all instances of the deparment name and price and change them. How can I make it so when the document opens they have fields to enter the department name and price etc and then all areas where this is required are populated in the document?

Thanks for any help
 
I would use VBA in Word.
Place bookmarks in all the places where you want to insert the information, like dep1, dep2, dep3, ... price1, price2, .... And then in [tt]Private Sub Document_Open()[/tt] loop thru the bookmarks and insert the deparment name and price.

Have fun.

---- Andy
 
And I'd use two document variables for that, insert a docvariable field at the specific places and upon opening the doc just use two simple inputbox lines to ask for their desired values once.
Maybe add a macro tool button to be able to correct the values in case you mistyped at first.
Or use a small custom form with two text boxes instead of inputboxes.
Whatever floats your boat.
:)

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
In Word 2003, you probably used formfields, possibly allied with REF fields, in a document with forms protection. This is fine for documents where the only variables are the field content. You can still use formfields and REF fields in the most recent Word versions. No vba, docvariables, etc required.

Cheers
Paul Edstein
[MS MVP - Word]
 
Good advice macropod.
I'm not a technical writer so I never needed something like this, but these REF fields sure do seem to work nicely!
I just tried it.
[thumbsup2]

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
When used with formfields, the idea is to set the formfield's 'calculate on exit' property and to point the REF field to the formfield's internal bookmark name - which can also be viewed/set by examining the formfield's properties.

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top