owner/author of a file

D

Dennis Hancy

I need to produce a listing of files along with date created, date
modified, owner, and author. I am using the file properties
dateCreated and dateLastmodified for the first two.

Are there similar properties to get the owner and the author?

If not, how else can I get this information?

Thanks.


Dennis Hancy
Eaton Corporation
Cleveland, OH
 
A

Alasdair Stirling

Use the workbooks BuiltinDocumentProperties as follows:

Sub alpha()
Range("a1").Activate
With ActiveCell
' date created
.Value = ThisWorkbook.BuiltinDocumentProperties.Item(11).Value
' date last saved
.Offset(1, 0).Value =
ThisWorkbook.BuiltinDocumentProperties.Item(12).Value
' author
.Offset(2, 0).Value =
ThisWorkbook.BuiltinDocumentProperties.Item(3).Value
End With
End Sub

There is no BuiltinDocument Property for Owner. There are two solutions to
this limitation. Either create a CustomDocumentProperty as follows:

ThisWorkbook.CustomDocumentProperties.Item("Owner").Value = "SomeName"

where "SomeName" is the name of the person owning the document. If you iuse
this method you recall the property as follows:

ThisWorkbook.CustomDocumentProperties.Item("Owner").Value

Alternativly, you might use another BuiltinDocumentProperty e.g. Manager.

You can enter all of these properties manually (via Excel's Properties
dialogue) or via VBA (See Chip Pearson's website for details of how to do
this with VBA).

Regards,

Alasdair Stirling
 
D

Dennis Hancy

Does Builtindocumentproperties only work on Excel worksheets within a
workbook?

The file listing I need to produce comes a user-specified folder name.
In Windows Explorer, I can choose a number of columns to display. As a
default, I get Name, Size, Type, and Modified. However, I have the
option of displaying other columns as well - including Owner and Author.

The files can be anything - not just Excel files.

Because I can display these properties within Windows Explorer, does
that mean I get to these properties via Excel VBA?

Thanks.


Dennis

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
G

Gord Dibben

Dennis

Not too automatic, but......

You could stick all workbooks into one Folder.

Open Windows Explorer.

Right-click on any column header and add a check to each of the columns of
information you wish to show(author, owner etc.).

Then..........

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom features.

OR Go to DOS(Command) prompt and directory.
Type DIR >MYFILES.TXT

All the above create a *.TXT file which can be opened in Excel.

Gord Dibben Excel MVP
 
A

Alasdair Stirling

Document Properties (Builtin and Custom) are apply to the Workbook and not to
the indivdual worksheets within a workbook. The options that column options
that Windows Explorer offers you are linked to the Builtin Document
Properties and these document properties are common (but not identical)
accross the MS Office applications. Accordingly, you can wrie some VBA code
to set the document properties and then configure the Explorer window to
display those that you have written to the Office files.

Regards,

Alasdair Stirling
 

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

Top