Display files, but with a twist

NascarBaritone

Registered User.
Local time
Today, 12:58
Joined
Sep 23, 2008
Messages
75
Here is the code I am currently using:
Code:
Private Sub Command207_Click()
Dim X As String
    vardoc = Me!LastName.Value & ", " & Me!FirstName.Value & " " & Me!Branch.Value & "\OBA\"
    X = Left(Me!LastName.Value, 1)
    If X >= "A" And X <= "G" Then
        vardoc = "H:\OP_PLUS\EQSALES\COMPLIANCE\Registered Reps 2008\Reps\Last Name A-G\" & vardoc
    ElseIf X >= "H" And X <= "N" Then
        vardoc = "H:\OP_PLUS\EQSALES\COMPLIANCE\Registered Reps 2008\Reps\Last Name H-N\" & vardoc
    ElseIf X >= "O" And X <= "Z" Then
        vardoc = "H:\OP_PLUS\EQSALES\COMPLIANCE\Registered Reps 2008\Reps\Last Name O-Z\" & vardoc
    End If
    If Dir(vardoc) = "" Then
        MsgBox Me!FirstName.Value & " " & Me!LastName.Value & " does not have OBAs"
    Else
        Application.FollowHyperlink (vardoc)
    End If
End Sub

When I click on the Command207 button, Windows Explorer opens up with the contents of the selected folder. It does exactly what I want it to do. However, I was hoping to make a pop-up box that does the exact same thing, but without the ugly folder hierarchy on the left-hand side of the pop-up box. What would be ideal would be a nice, neat, clean pop-up box that has only the icons of the files located in the folder.

Any suggestions?
 
Instead of using Application.FollowHyperlink, try

Call Shell("Explorer.exe " & vardoc,vbNormalFocus)

Hope it helps
 
Thanks for the reply.

I actually started with your code, but had to slightly modify it as my folders had commas in them.

My code ended up being:

Call Shell("Explorer.exe ,""" & vardoc & """", vbNormalFocus)

Works like a charm now!
 

Users who are viewing this thread

Back
Top Bottom