Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created May 19, 2014 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumatti1/f35af1fba2f822091bbb to your computer and use it in GitHub Desktop.
Save kumatti1/f35af1fba2f822091bbb to your computer and use it in GitHub Desktop.
エクスプローラでのパス列挙
Option Explicit
Sub hoge3()
Dim o As Shell32.FolderItems3
Dim v As Shell32.FolderItem2
Dim Shl As Shell32.Shell
Dim Win As InternetExplorer
Const StrPath As String = "C:\Temp"
Set Shl = New Shell32.Shell
For Each Win In Shl.Windows
If Win.FullName Like "*\Explorer.EXE" Then
If Win.document.Folder.Self.Path = (StrPath) Then
Set o = Win.document.Folder.Items
Exit For
End If
End If
Next
For Each v In o
' Debug.Print TypeName(v)
Debug.Print v.Path
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment