I have a button on an MS Access 2003 form that opens a Windows Explorer window at a specified folder location.
The code works perfectly.
The folder contains JPG images.
The window opens in Details view.
I want it to open, or be changed to, thumbnails view in XP or Extra Large Icons in Windows 7
I have some familiarity with Windows API coding -- not a lot -- and not enough to figure out how to do this.
As this is a database application run on 13 units, with 10's of thousands of folders, no suggestions of going into Folder Options | View will be entertained. It must be coded. I have looked at Bags and BagsMRU in the registry and can't figure out how to make that work.
Any suggestions will be welcome.
Private Sub cmdOpenFolder_Click()
Dim db As Database
Dim rs As Recordset
Dim WindowState As Integer
Dim mypath As String
Set db = CurrentDb
Set rs = db.OpenRecordset("select distinct Path from tblPictures where [JobID]=" & Me.JobID & ";", dbOpenDynaset, dbSeeChanges)
'Bail on an empty recordset
If (rs.EOF And rs.BOF) = False Then
If rs.RecordCount > 1 Then
WindowState = vbNormalNoFocus
WindowState = vbMaximizedFocus
Do While rs.EOF = False
Shell "explorer.exe " & Chr(34) & rs!Path & Chr(34), WindowState
mypath = rs!Path