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

Who created that file?

Status
Not open for further replies.

kel1981b

Programmer
Jan 3, 2003
82
0
0
US
I need to write VB 6.0 program to find out who creates particular file. B-) How can I do that? Is there some attributes, functions I can use?
Tnanx in advance.

[thumbsup]
 
Thanks for your try cLFlaVA.
Unfortunately, there is no way to get information about file creator using FSO. At least I was not able to find that way.

[thumbsup]
 
strongm thanks for your try.
Actually I found easier way to do that [thumbsup] - Shell Object. If somebody is interested in code let me know.
Thanks everybody.

[thumbsup]
 
>If somebody is interested

It's what this site is about. Please share your solution
 
Sorry about late reply [purpleface]
Here is code example
You have to refer to Microsoft Shell Control and Automation
Code:
Dim arrHeaders(34) As String

Dim objShell As Shell
Dim objFolder

Dim I As Integer

Dim strFileName

Dim itmAdd As ListItem
Dim strCreatedOn As String
Dim strFileExt As String

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.NameSpace(strFile)
lstFile.ListItems.Clear

For I = 0 To 10
    arrHeaders(I) = objFolder.GetDetailsOf(objFolder.Items, I)
Next

For Each strFileName In objFolder.Items
    For I = 0 To 10

       strFileExt = Right(strFileName, 4)
       
       If Right(strFileName, 4) = ".doc" Then
         
                         
            
            If arrHeaders(I) = "Author" Then
                If objFolder.GetDetailsOf(strFileName, I) = txtUserName.Text Then
                   
                   lstFile.Visible = True
                    Set itmAdd = lstFile.ListItems.Add(Text:=strFileName)
                    itmAdd.SubItems(2) = objFolder.GetDetailsOf(strFileName, I)
                    itmAdd.SubItems(1) = strCreatedOn
                End If
            Else
                If arrHeaders(I) = "Created" Then
                   strCreatedOn = objFolder.GetDetailsOf(strFileName, I)
                End If
                
            End If
      End If
      
       
    Next
Next
Set objShell = Nothing
You must modified it according to your needs

[thumbsup]
 
You could also try this thread:

thread222-488582

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top