View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Melody Melody is offline
external usenet poster
 
Posts: 51
Default Print Directory to Excel

Simple to you, not to me. :) If you could integrate it into the existing code
that would be great. As I said, I'm not very experienced with Visual Basic.
I know enough to somewhat figure out a program which is probably just enough
to be dangerous.

"JP" wrote:

Thank you. Here's some sample code that will give you the Owner
property of the files in a folder. This routine simply prints the
filename and owner into a worksheet, do you need help integrating it
into your existing code?

Sub GetOwner()

Dim f As Object
Dim sh As Object
Dim fl As Object
Dim NextRow As Long

Set sh = CreateObject("Shell.Application")
Set fl = sh.Namespace("C:\My Files\")

NextRow = WorksheetFunction.CountA(Range("A:A")) + 1

For Each f In fl.Items
Cells(NextRow, 1).Value = f.Name
Cells(NextRow, 2).Value = fl.getdetailsof(f, 8)
NextRow = NextRow + 1
Next f

End Sub

(Based on http://classicasp.aspfaq.com/files/d...of-a-file.html)


--JP

On Sep 29, 3:35 pm, Melody wrote:
Open Windows explorer (2003), if you right click on the column headings
you'll see a list of available options. One of those is Owner. My guess is
that's the same as Last Saved by.



"JP" wrote:
Sorry, let me go back one step. Are you able to view this information
manually? If so, where specifically do you see it?


I don't recall there being an "owner" property of a folder or file,
only a "created by" or "last saved by" property. How would it be
determined or enforced?


--JP