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

Billy Hill

Board Regular
Joined
Dec 21, 2010
Messages
67
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:

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Watch MrExcel Video

Forum statistics

Threads
1,109,143
Messages
5,527,072
Members
409,743
Latest member
sukuto20

This Week's Hot Topics

Top