Excel 2002 Print File Properties

A

Ateniense1

Is there a way to print an Excel 2002 file properties when priting the file?
 
F

Frank Kabel

Hi
what properties do you want to print (and where: header/footer or a
cell)?
 
F

Frank Kabel

Hi
you may use the following function (put this in a standard module):
Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties (prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

Now add the following procedure in your workbook module (not in a
standard module)
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.LeftFooter = Format(DocProps("Creation date"),"MM/DD/YYYY")
.Centerfooter = Format(DocProps("last save
time"),"MM/DD/YYYY")
.RightFooter = DocProps("last author")
End With
Next wkSht
End Sub
 
Top