|
看了你在新闻组的提问,有人做了回答.但在我电脑上运行通不过,于是就上网找了资料,对其中13改成了14,结果通过.就是如下代码,想必这次应该算是合你要求了吧.
Sub Main()
Const WINDOW_HANDLE = 0
Const OPTIONS = &H10&
Dim ObjFolder
Dim ObjShell
Dim ObjPath
On Error Resume Next
Set ObjShell = CreateObject("Shell.Application")
Set ObjFolder = ObjShell.BrowseForFolder(WINDOW_HANDLE, "请选择一个目录:", OPTIONS)
If ObjFolder Is Nothing Then
Exit Sub
End If
Set objFolderItem = ObjFolder.Self
ObjPath = objFolderItem.Path
Dim MyText
Set ObjShell = CreateObject("Shell.Application")
Set ObjFolder = ObjShell.Namespace(ObjPath)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim arrHeaders(14)
arrHeaders(14) = ObjFolder.GetDetailsOf(ObjFolder.items, 14)
For Each strFileName In ObjFolder.items
filnm = ObjFolder.GetDetailsOf(strFileName, 0)
If True And Right(filnm, 4) = ".doc" Then
For i = 0 To 100
Debug.Print i, ObjFolder.GetDetailsOf(strFileName, i)
Next i
pg = ObjFolder.GetDetailsOf(strFileName, 14)
MyText = MyText & vbNewLine & strFileName & "文档共有" & pg & "页"
End If
Next
MsgBox MyText
End Sub
|
|