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!

Automatic insertion of header and footer in document

Status
Not open for further replies.

coposg

Programmer
May 28, 2003
37
0
0
AU
Hi all,

I was wondering if someone could assist, I wanted to know if we can automatically display the header and footer in all documents, new and existing, without having to toggle the settings through View -> Header and Footer?
My thoughts were that editing the normal.dot could solve the problems for all future documents, but am a bit unsure as to how we would get the header/footer to be displayed automatically when opening an exisiting docxument (maybe we would need some VBA coding?).
Look forward to any suggestions anybody may have.

Thanks
Steven Paice
 
create your header and footer detail in a blank page

Save as NormalXXX.dot (document template)

close Word (and Outlook if it uses word as it's Editor)

Go to where Normal.dot and the new NormalXXX.dot reside (Username\Application Data\microsoft\templates ???)

Rename Normal.dot to NormalOriginal.dot
Rename NormalXXX.dot to Normal.dot

Open Word
 
sorry ..that works for page numbering but not necessarily for Filename & Path etc.
 
Hi coposg,

What do you mean? Do you really want to open *all* documents in Header and Footer view? And, if so, why?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Tony,

It is really a business related issue; we have tried encouraging people to show headers and footers when printing for easy document retrieval, but we still face problems, so we are looking at a different approach, that is, opening documents in header and footer view by default.

Thanks
coposg
 
Hi coposg,

You can't print a document without headers and footers, so I guess what you're saying is that you want certain information to appear in all headers and footers and you're trying to enforce it by throwing people into header/footer view.

If I read you right, this is completely the wrong way to go about it. Create a template which includes the information you want and tell people to use it.

Ultimately you can't *force* this kind of thing and you must train your users. What you can do is make it as easy as possible for them to do what is required. Everybody has their own Normal template but there is no reason why corporate documents should not be based, as a matter of procedure, on corporate templates.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Tony is correct. If you want specific information to BE in documents, then put it there through using templates that have it there.

This is what templates are for.

But yes, you CAN open headerfooter on document open. It is straitforward VBA, not difficult at all.
It is really a business related issue; we have tried encouraging people to show headers and footers when printing for easy document retrieval
I do not understand this at all. As Tony mentioned, the headers and footers will print - they always do. So "show headers and footers when printing" does not mean anything. They always do.

And the next part certainly needs clarification. What does showing headers and footers (for printing, or anything else) have to do with "easy document retrieval"?

There may indeed be a business case for SOMETHING (and I suspect there is), but you are going to have to elaborate.

Gerry
 
fumei said:
Tony is correct.

I love reading that [smile]

I'm (genuinely) never sure. All I know is there's a lot I don't know.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
You could encourage this by using a fairly simple VBA macro. The path/filename is already an AutoText item. So only a simple macro is needed to add the Autotext into the footer on the final page (or all footers or wherever you want it). Once you have the macro tested, add a Toolbar button so that all the lazy users need to do is click on the button once. They can sometimes manage that!




Regards: tf1
 
On the whole, I concur.

If you want to ensure documents start out with certain information in the header/footer, put the required information in the underlying template. That includes filename fields if you want the filename (and, perhaps the path) to appear in all documents.

If you have other variable information that users are supposed to fill in, you can do that via ASK or FILLIN fields, but the process is not so straigthforward; if you create a template document with FILLIN or ASK fields to prompt the user for info when creating a new doc, then set the print options to Update Fields, this normally causes the FILLIN and ASK fields to prompt the user to answer the same questions again, or click cancel. To avoid this-

1. In the template document, create ASK fields in the format:
{QUOTE{IF{BkMrk}= "" {ASK BkMrk "Your prompt goes here" \d ""} ""}{BkMrk}}
where BkMrk is a bookmark named to match the particular question.

2. Then, at the start of each field, create an empty bookmark corresponding to whatever you call BkMrk for that field. You can do this using a SET field (eg {SET BkMrk ""} inserted before the '{QUOTE' or via Insert|Bookmark, with nothing selected.

3. Save the template. If you created the bookmark via via Insert|Bookmark, don’t answer the question before saving the template, otherwise you’ll have to delete the BkMrk bookmark and re-create it.

Now, when the template is printed, users will only be prompted to update any ASK fields they haven't answered.

Note: If you use a SET field (eg {SET BkMrk ""} to create the bookmark, the SET field will clear the bookmark every time the document is opened, and you’ll be prompted to answer the questions again if you try to re-print the document. This might be useful if the required output changes from time to time. In that case, you could delete the '\d ""' from the ASK field to retain the previous answer.
 
Thanks all for your feedback, perhaps I should have defined the problem better, when a document is printed without a header and footer, retrieving this document electronically from our very complicated network becomes near on impossible.
And while I appreciate that one answer may be, as suggested in one reply, 'straight-forward VBA', I have no VBA experience, hence my query for assistance in the first place.
And furthermore, we cannot incorporate the changes directly into the corporate normal.dot template, as we have no admin control over the templates.
So I think I will stick with training lazy users, and possibly look into a macro as suggested by tf1, thanks again

coposg
 
To repeat, you are posting things that do not make sense.
when a document is printed without a header and footer, retrieving this document electronically from our very complicated network becomes near on impossible.{/quote]

I hate to tell you this, but.....if you print ANY document with , OR WITHOUT, headers and footers it makes absolutely zero difference to the electronic retrieval of anything.

Could you explain how printing a document makes a difference to electronic retrieval?

Say you have two documents - for simplicity, have them in the same folder. One has a header/footer, the other does not. You print them both. How on earth does printing EITHER of them make a difference to retrieval?

I am seriously curious as to what you think could make a difference. Printing sends a document to a printer...uh, nothing else.

To repeat the question....what is the problem exactly? You still have not described it in a way that we can work with. Or rather the description (as stated) does not make sense.

To repeat, I suspect that you have a business case to try and get SOMETHING happening. I wish I could help, and probably could...if I knew what you need. But printing as an aspect of document retrieval makes no sense.

1. You do not need to touch normal.dot. It can be done without that.

2. training lazy users ......TO DO WHAT?? Keep asking but not getting an answer.

3. in the first post you wonder about edit normal.dot, now you say you can not incorporate changes to normal.dot. This is inconsistent.

4. are these document created from a real template (NOT normal.dot)? If not, then that may be the answer. Make templates, and use them.

This one is nagging at me, because I sense there is a real problem for you. I am completely positive there is a solution. Either using ASK or FILLIN fields, or perhaps a UserForm that gets information from the user. I can't say because I still have no clue what you actually need.

But I DO know that printing headers and footers - or anything else from a document - is going to make diddley squat difference to electronic retrieval. Not unless you have some code behind this that you have not mentioned.

Gerry
 
You have made your point Gerry, perhaps I need to simplify my problem even more - if I print out a document without printing the file path in the footer, hand you the hard copy and ask you to modify the document electronically, what would be the first thing you would ask? Where is the file, right?
I didn't realise I was speaking in another language, or that I could manage to confuse so many technical users. I hope this has explained the problem properly, because I find it hard to comprehend that I am the only person who has faced this problem.

Thanks for your time
Steve
 
Well a very simple macro inserting the Path/Filename AutoText into the document would seem the simplest solution.

Never edit normal.dot to put anything into the Header or Footer as it will screw up other Word functions that are based on normal.dot (such as label creation). Hoever, does your company base all documents on normal.dot or do you have company templates? Editing company templates would be the correct solution.

Regards: tf1
 
Hi Steve,

I don't know what to say - I don't think you have confused a lot of technical people, I think you have failed to understand what they are all telling you.

You want the same information added to every document but you don't want to include it in the template. You want the first thing everybody does with a new document to always be exactly the same thing instead of having a process which entirely automates it.

The amount of work setting up either option is about the same. The reliability of automating the process is far greater than that of doing it manually. The marginal cost of using the automated process is effectively nil; the marginal cost (in user's time) of using the manual process is, say 50p to £1 per document. The training cost of using the automated process is nil; the training cost of using the manual process is, for argument's sake, £10 per user (although probably more in reality). Of course the choice is for your company make.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
if I print out a document without printing the file path in the footer, hand you the hard copy and ask you to modify the document electronically, what would be the first thing you would ask? Where is the file, right?

Yes, Steve it would be.

However, if I may point out - YOU NEVER, EVER, mentioned handing someone a physical piece of paper and asking them to get it electronically. I apologize if I was actually trying to get enough information to give a good response, and cared enough to ask repeatedly. I 'm sorry...I left my mind reader hat some place.

Further, to repeat, again, having the header and footer printed is not the issue. What if you had the filename and path NOT IN THE header and footer? What if it was in the first line right in the text? Well, gosh Steve, the header and footer would be blank...but the information would be there. And yeah, having ink on that piece of paper would really speed up the electronic retrieval. But the header and footer would be blank. Kind shoots your statement about headers and footers affecting electronic retrieval.

You did not confuse anyone. You did not state clearly what you wanted to say.

Look, as has been pointed out, you can easily have a document footer contain the filename and path. It is an AutoText item.

As Tony points out having it automated is of far greater reliability that having users do it manually.

If your documents are based on normal.dot, this is simply a mistake. Period. It is far more secure, and reliable to use proper templates. But in case this is not possible, then get corporate permission to have the header or footer contain the filename and path. If it is so crucial for electronic retrieval, then put the darn thing into normal.dot. The consequence is that ALL documents will have the filename and path in the header, or footer.

This is NOT a big deal. It would take literally 4 or 5 seconds.

Gerry
 
Thanks to all of you for the feedback, and by not describing my problem 100% and word-for-word it seems as though alot of time has been wasted, but I have an answer to my question, and will use a macro to solve my problems.
Next time I will word my query better, so hopefully the sarcastic and arrogant answers will be eliminated. Gerry while I appreciate your assistance, your tone and method of answering can definitely improve.

Thanks
Steve
 
That is, I was so frustrated at not getting decent information, and feeling like none of us was being listened to, yeah ...it was meant to be.

I will not apologize for the method - yes perhaps for the tone - for the method was to try and get information repeatedly. It was not forthcoming.

Oh well.

Gerry
 

I'm interested. Where are you going to put your macro if, as you say, you have no admin control over the templates?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top