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

How to create banner page with document properties?

Status
Not open for further replies.

alex20850

Programmer
Mar 28, 2003
83
US
I have twenty documents that I need to print a banner page between each document before each document. I want to include the information from the document properties. If I say print document properties with the document, it prints AFTER the document when I want to print BEFORE each document.

Thanks!
 
I know of no way to do this, at least by setting something. Document Properties are printed (if set as True) on a separate page at the end of the document.

You could, I suppose, gather the Document Properties and write them to a page at the start of the document, print the document, then delete that page.

Seems kind of messy though. Why is this significant/important?

faq219-2884

Gerry
My paintings and sculpture
 
You can easily print the doc properties on a separate sheet BEFORE the document is printed, but you will not be able to format them as a Banner.

To do this, create a macro that detects the Print command and runs its own Print, Print What, Doc Properties before it prints the document.

You may be able to achieve exactly what you want by creating a template using Doc Property fields. Intercept the Print command so that it runs a macro which adds the template to the front of the document, updates the fields and prints if off along with the document.

But the potential problems with this are messing up the page numbering and ToC, etc.

I expect that a Word programming expert could create a macro that would extract the document property fields from the open document, add them to a template, send it off to the printer, close it and then executing a print command on the actual document.

I think the best you can do is to create a front page in its own section, add the doc proerty fields formatted in a banner. This will stay permanently at the front of the document though, but it will do what you want and no user intervention will be required: the users just need to ignore it.



Regards: tf1
 
I was asked why I wanted the document properties to print before each document. The reason was just to make it easier to organize and distribute the documents. If it prints before the document, it is a cover page and I can see what categories by subject or author the document should go in. I finally just printed the documents and manually put the document properties page at the beginning of each document and stapled them. I was trying to fix it this time because I might be dealing with 75 or 80 documents in the future.
 
The simple class instantiated in Normal.dot can do it:
Code:
Public WithEvents wdApp As Word.Application

Private Sub Class_Initialize()
Set wdApp = Application
End Sub

Private Sub Class_Terminate()
Set wdApp = Nothing
End Sub

Private Sub wdApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
Doc.PrintOut Item:=wdPrintProperties
End Sub
The only problem in my case is a delay between printing dicument prpperties and the document.

combo
 
If it prints before the document, it is a cover page and I can see what categories by subject or author the document should go in. "

Then why not make it a cover page? The issue of ToC may have impact, but if you really want it as a cover page, then why not make it one?

I am not understanding "should go in". Go in where? You are talking about hardcopy. Not only that, but you are stapling them. WHERE is the decision point?

If you are processing multiple files in a folder, what exactly is your process? You could action the printing BY the categories/author.

combo's suggestion could work for you though.

faq219-2884

Gerry
My paintings and sculpture
 
These are standard operating procedure documents have a last modified date that is important.

If I create a cover page and save the document, the last modified date will be lost.

To process multiple files in a folder, I go to File, Open, select the files and then select the files and Tools, Print.

The categories/authors are unknown unless I open every single one of the documents.
 
I would think that the code above would work with *new* documents, but once again I don't want to open and save the documents since that would overwrite the last modified date.
There does not seem a way to print the document properties at the beginning of a document without saving over the last modified date.
 
Nope. You open and print it and PRINTED is changed, and therefore the file has to be modified to show that.....

What if you used DSO to get the properties and print those as a separate print job between document printing? This would of course be a scripted process, rather than:

"File, Open, select the files and then select the files and Tools, Print. "

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top