|
- Function GetPagesCount(ByVal flPath As String) As Integer
- Dim fso As Object, fl As Object, shl As Shell32.Shell
- Dim fdPath$, flName$, i&, shfd As Shell32.Folder
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set fl = fso.GetFile(flPath)
- fdPath = fl.ParentFolder.Path
- flName = fl.Name
- Set shl = New Shell
- Set shfd = shl.NameSpace(fdPath)
- For i = 0 To 300
- If Left(shfd.GetDetailsOf(0, i), 1) = "页" Then 'XP中为"页数",Win7中为"页码范围",所有直接查找"页"
- GetPagesCount = shfd.GetDetailsOf(shfd.Items.Item(flName), i)
- Exit Function
- End If
- Next i
- End Function
复制代码
|
|