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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Watch MrExcel Video

Forum statistics

Threads
1,114,355
Messages
5,547,435
Members
410,792
Latest member
Jabberwokki
Top