Solved

How can I repeat (reuse) header text in the document body

Posted on 2015-02-23
5
56 Views
Last Modified: 2016-02-12
I use a macrobutton in the header of a document to identify the spot where a company name should be entered.

I want the entered company name to appear throughout the document body immediately, no updating required.

I have tried using a specific style and a styleref field. The entered text will not appear automatically. Apparently, the styleref field is only effetive when it is used in the header, that is, it only updates automatically when it is in the header and references text in the body.

Is there a way to make text entered in the header at the macrobutton appear throughout the body of the document automatically? I don't want to have to update fields, etc.

I considered a bookmark, but a bookmark is likely to get deleted by accident.

The template I am working on will be used by other people. It's not likely they will be able to handle any manual work for updating any fields.
0
Comment
Question by:JasonLattin
  • 3
  • 2
5 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 500 total points
ID: 40626090
What part does the macrobutton play? Why not add field updating to the code?
0
 

Author Comment

by:JasonLattin
ID: 40626345
First, thanks for your help.

I use the macrobutton to mark the spot that the user should type the company name. It looks something like:

<<Click. Type customer name.>>

Clicking the spot selects the text, and typing the name automatically deletes the placeholder text.

It's not a macro in the truest sense of the word. I can't use a true macro because the users may have security enabled that disables macros.

There's more info about the macrobutton here: http://word.mvps.org/FAQs/tblsfldsfms/usingmacrobutton.htm

I have attached the template that I am working on that you can see the macrobutton in use.

My hope is to enter the customer name in the header and have it appear throughout the agenda (see red customer).
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 40626789
As you realise, macrobutton fields were designed to initiate a VBA macro procedure.

In its turn, VBA is there to fill in any gaps that are perceived in the application's functionality.

Because VBA is so powerful, it could be a security risk so there are mechanisms to reduce the risk. Preventing all VBA execution just one of the options available in the Trust centre.  There are others, but you may have to go down the path of having digitally signing macros.

If Word fields had the same level of complexity, they would also be a security risk, and Microsoft would have to design a parallel mechanism to disable them.

Can you consider entering the text directly in the document body, instead of in the header?
0
 

Accepted Solution

by:
JasonLattin earned 0 total points
ID: 40626826
@GrahamSkan

I was already working on your suggestion. I have set up the template so that the company name (text) is entered in the body instead of the header. See the attached revised template. Type the company name at the point noted at the top of the document (click the red text and type) , and then press Ctrl+A, F9 to update the company name in 21 places in the document marked by styleref fields.

This approach will work, but I was hoping to find a way to make it work using the header if possibile.

Using VBA and an actual macro is not an option for reasons too lengthy to discuss here.

Using a macrobutton with no macro defined is acceptable and the use functions only as a  placeholder. The macrobutton with no macro defined (which is well-documented as an acceptable use) and a styleref field is the direction I have to take.

Based on my testing and research, it appears that my approach of using a macrobutton in the header will not work so I guess we can close this issue.

Thanks for all your help.
IR-Implementation-Project-Kickoff-Agenda
0
 

Author Closing Comment

by:JasonLattin
ID: 40641312
Graded as B because I worked on the suggested approach before it was recevied.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

911 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

24 Experts available now in Live!

Get 1:1 Help Now