Question about header and printing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a problem that I don't know how it's best solved. This is what I need
to do:

1. I have lots of documents in a database. Each of them needs a header with
info about author, date, version and some custom fields.

2. Other people can open these documents from the database. They must easily
be able to print these documents either WITH or WITHOUT the document info.

3. This document info must be a header for each page and not only a separate
page that it is when document properties are printed.

How can I achieve this? I find it a bit complicated if people have to
manually delete the header if they want to exclude it from printing. But I
want the header visible on screen, so I can't hide it. Otherwise it would be
easy to print hidden text when the header needs to be printed.

I also don't want it to be too complicated to add the document info to
already existing documents.

Any suggestions?
 
westis said:
I have a problem that I don't know how it's best solved. This is what
I need to do:

1. I have lots of documents in a database. Each of them needs a
header with info about author, date, version and some custom fields.

2. Other people can open these documents from the database. They must
easily be able to print these documents either WITH or WITHOUT the
document info.

3. This document info must be a header for each page and not only a
separate page that it is when document properties are printed.

How can I achieve this? I find it a bit complicated if people have to
manually delete the header if they want to exclude it from printing.
But I want the header visible on screen, so I can't hide it.
Otherwise it would be easy to print hidden text when the header needs
to be printed.

I also don't want it to be too complicated to add the document info to
already existing documents.

Any suggestions?

The first big question is: Are all of these documents based on the same
template? Or are you faced with a thicket of dissimilar documents based on a
variety of templates?

The second question is: Do the documents all have just one section or
possibly more than one; and in each section do they use only the primary
header, or also first-page and/or even-page headers?

Being optimistic and assuming the documents are uniform and all share one
template, I think you can solve the printing problem fairly easily. You need
a macro in the template for printing a document without the header, and a
custom toolbar button (and possibly a menu item also) to run that macro.
Printing with the header is done with the standard Print button or menu
item.

The code of the macro will probably have to be tailored a bit to your
circumstances, but the general flow is this:

- Set the font color of the header text to white. This maintains the size of
the header so the pagination doesn't change, but the text won't print. If
there are multiple sections, or multiple headers per section, you need a
loop to catch all of them. If there are any graphic objects in the header,
they can also be made nonprinting by setting their brightness to maximum and
their contrast to zero.

- Either send the document directly to the default printer or display the
Print dialog to let the user choose the printer. The template could be
designed to let the user pre-set an option so the same macro could do
either, but it would probably be simpler to provide two macros and two
buttons if you need that flexibility.

- Undo the changes in the first step, leaving the header visible again and
preventing Word from thinking the document has changed and needs saving.

The process for adding the header to existing documents is a completely
different consideration. That could probably be done by another macro, built
along the lines of the one in
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm.
 
You could put your fields in a textbox in the header. If upon printing you
select the option to _not_ print drawing objects, then the textbox and its
contents will not be printed. Of course, any other drawing objects would
also be left out.

This is far from an ideal solution. Fields in textboxes are more problematic
than in the document layer. Nevertheless, it may do what you want simply.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
Thanks both Jay and Charles!

Learning from Charles I came to think of a third solution, pasting the
header as an object. Then I can also untick the option to print drawing
objects, and the rest of the text will "move up" as if the header wasn't
there. But with that method I can't use page numbering (or I would have to
add that separately on top of the object).

As I'm not very experienced with macros I think I'll try to use the textbox
method and make the top margin for the header as little as possible, so that
the tall header won't affect the page layout too much when printing without
header.

Thanks for your advice!

/Daniel

"Charles Kenyon" skrev:
 
If you want the page numbering to appear whether or not you print the rest,
put it in the header but outside of your text box.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top