举个栗子:- Dim Shell
- Set Shell = CreateObject("Shell.Application")
-
- For Each window In Shell.Windows()
- If LCase(Right(window.FullName,13)) = "\explorer.exe" Then
-
- window.Document.CurrentViewMode = 1
- '设置查看方式为缩略图
-
- window.Document.IconSize = 48
- '设置图标尺寸为 48
-
- window.Document.SortColumns = "prop:-System.DateModified;"
- '设置排序方式为按修改日期逆序排列
-
- window.Document.GroupBy = "System.DateModified"
- '设置分组依据为修改日期
-
- window.Document.SelectItemRelative(0)
- '选中一个比较帅的文件
-
- MsgBox "标题: " & window.LocationName & vbCrLf &_
- "路径: " & Replace(Mid(window.LocationURL,9),"/","\") & vbCrLf &_
- "选中: " & window.Document.SelectedItems().Count & " 个文件/文件夹"& vbCrLf_
- Exit For
- End If
- Next
复制代码
|