Physical File Search : Hidden Files

M

Manuel

Hi,

I already created a Function that is searching files, using
"Application.Filesearch" (see below).

But this does function not "see" HIDDEN Files (for expample a Word Document
with a setting "Hidden=True").

But I need also to get a TRUE of hidden files.

How to do that?

Greetings Manuel


Dim fs As Object
Dim i As Integer
Dim strFile As String
Dim strPath As String

strFile = ""
strPath = ""

If Not gbNull(sFilePath) Then
Set fs = Application.FileSearch
With fs
strFile = Mid(sFilePath, InStrRev(sFilePath, "\") + 1)
strPath = Left(sFilePath, Len(sFilePath) - Len(strFile) - 1)
.LookIn = strPath
.FileName = strFile
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
mCheckPhysicalFile = True
Else
mCheckPhysicalFile = False
End If
End With
Else
mCheckPhysicalFile = False
End If
 

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