Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created May 21, 2014 03:28
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/9533c4833a1faf62478b to your computer and use it in GitHub Desktop.
Save kumatti1/9533c4833a1faf62478b to your computer and use it in GitHub Desktop.
無理山
Option Explicit
Private WithEvents d As Shell32.ShellFolderViewOC
Private WithEvents ie As SHDocVw.InternetExplorer
Private flg As Boolean
Private Sub d_EnumDone()
flg = True
Debug.Print "d_EnumDone"
End Sub
Private Sub ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
d.SetFolderView ie.Document
End Sub
Private Sub UserForm_Initialize()
Set d = New Shell32.ShellFolderViewOC
flg = False
Dim o
Dim v
Dim Shl As Shell32.Shell
Dim Win As InternetExplorer
Dim h As Long
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 ie = Win
Dim doc As IShellFolderViewDual3
Set doc = ie.Document
doc.FilterView "hoge"
Do
DoEvents
Loop Until flg = True
Set o = doc.Folder.Items
For Each v In o
Debug.Print v.Path
Next
Exit For
End If
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment