Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing File Properties (97)

    How do you print document properties in Excel? I can view them, but cannot print them. I know how to do it in Word in the print dialog box, but that option is not available in Excel.

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printing File Properties (97)

    Not possible, but here's a macro to do it. HTH --Sam
    <pre>Option Explicit

    Sub PrintDocProperties()
    Dim p As DocumentProperty
    Dim i As Integer
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    On Error Resume Next
    ActiveWorkbook.Worksheets.Add
    i = 1
    For Each p In ActiveWorkbook.BuiltinDocumentProperties
    Cells(i, 1) = p.Name
    Cells(i, 2) = p.Value
    i = i + 1
    Next p
    For Each p In ActiveWorkbook.CustomDocumentProperties
    Cells(i, 1) = p.Name
    Cells(i, 2) = p.Value
    i = i + 1
    Next p
    Columns("A:B").Select
    Selection.Columns.AutoFit
    With ActiveSheet
    .PageSetup.CenterHeader = "Properties for " & ActiveWorkbook.FullName
    .PageSetup.PrintGridlines = True
    .PrintOut
    .Delete
    End With
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    End Sub</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    New Lounger
    Join Date
    Apr 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing File Properties (97)

    What genius! It worked beautifully! <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing File Properties (97)

    Sam,

    The code is great but does it work everytime with XL97? I've found it not to return some of the properties such as "last time saved". I can view the properties of the file thru Windows Explorer and see the last time the file was saved.

    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •