Repeating Text throughout a doc

music_al

Board Regular
Joined
Nov 26, 2008
Messages
133
Im running Word 2007 and I want to enter a piece of text into a word document ONCE and for it to be repeated automatically any number of times within the same document.

In particular I want to enter a piece of text in a table cell and for that text within a particular cell to appear in the header (or footer)

How do I do this ?

Thanks in advance

Allan
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi Allan,

Format the text in a Style that isn't in use for anything else, then use a STYLEREF field referring to that Style in the page header.

Cheers
 
Upvote 0
Hi Macropod

I think you may have misunderstood what I am trying to do.

Imagine if I have a Template Document that is used over and over by different users. If within this template I have a 5 digit numerical field called "document_ref_number", rather than type the actual number (56789) over and over within the document, I just want to enter it once and for the number to be updated throughout the document automatically.

I wasnt referring to styles.

Thank you

Allan
 
Upvote 0
Hi Allan,

I understood the specification perfectly well:
In particular I want to enter a piece of text in a table cell and for that text within a particular cell to appear in the header (or footer)

If you want to repeat the # in the header, then using a particular Style for the paragraph concerned, and a STYLEREF field in the header is the simplest - and most reliable - way to do it. The problem with using bookmarks, as suggested by Marbles, is that they're all too easily deleted - plus they don't update until you preview or print the document

You've now said you have a 5-digit numerical field called "document_ref_number"? What is this 'field'? A formfield in a document protected for forms? A custom document property?

If its a formfield, you can still use the STYLEREF approach, or you can make sure the formfield properties are set to 'calculate on exit' then insert a cross-reference in the header to the formfield's bookmark name.

If it's a custom document property, then insert a DOCPROPERTY field in the header to retrieve the property's value.

Cheers
 
Upvote 0
Thank you very much Macropod :)

I found your tip after two hours of experimenting, reading help and googling. I was just about to give up :(




To elaborate:
  1. Give the text a style that will not be used for anything else. E.g. 'MyUniqStyleReff'.
  2. Place the curser where you want the first copy to be.
  3. Insert a styleref field:
Choose the command Insert, Field
Categories: Links and References
Field names: StyleRef
Style name: E.g. 'MyUniqStyleReff'
The result, when showing codes, will be something like this:
{ STYLEREF MyUniqStyleReff \* MERGEFORMAT }

The problems with alternatives:
Cell references: Can only "copy" numbers. Not text. At least I have not found a way.
Bookmarks: The bookmark is easily deleted when overwriting.

Thanks again :)
Anders
 
Upvote 0

Forum statistics

Threads
1,213,511
Messages
6,114,054
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top