Shell (Explorer) to control size, location and icon size (details)

Billy Hill

Board Regular
Joined
Dec 21, 2010
Messages
73
I'm making a little script to search multiple locations for the same file with different extensions.

I'm opening 3 windows to display the search results but I'd like to have more control over the windows. Currently they all stack up on top of each other and they are showing the large icons by default.

I'd like to size and position the windows and display "details" instead of large icons with sorting on Date (newest first).

Is Shell() the correct method to do this do I need to use window handles? The code I have so far is below. Any help would be greatly appreciated.

Code:
Sub SearchMulti()

Dim sSearchString

'Get search string
sSearchString = InputBox("Enter search string", "Search Multi")


'Search CAM files
Call Shell("explorer.exe " & Chr(34) & "search-ms:query=*" & sSearchString & "*.vnc&crumb=location:Z:\Production\Milling\" & Chr(34), vbNormalFocus)

'Search Drawings
Call Shell("explorer.exe " & Chr(34) & "search-ms:query=*" & sSearchString & "*.pdf&crumb=location:Z:\Document Control\Customer Files\Document Masters\" & Chr(34), vbNormalFocus)

'Search CAD files
Call Shell("explorer.exe " & Chr(34) & "search-ms:query=*" & sSearchString & "*&crumb=location:Z:\Everyone\SOLID MODEL FILES\" & Chr(34), vbNormalFocus)
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,885
Messages
6,122,085
Members
449,064
Latest member
MattDRT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top