Alexasaurus
New Member
- Joined
- Mar 26, 2022
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
I am very new to VBA and have been learning as I go on a work project. One of the things that was requested was to have a search bar to find other files of a similar problem solving event.
What I want to be able to do to have a vba program that opens file explorer and searches by tags. but all I have been able to manage to figure out is how to open the file explorer using Shell. I have searched high and low on the internet trying to find anything that will specify searching by tags.
If I use the search bar on the file explorer I can search by tags by typing "tags:[tag name]"
I tried something like
Sub SearchTool()
Dim searchlocation As String
Dim tagname As String
Dim searchtag As String
searchlocation = \\my files
tagname = sheet1.Range("A1").Value
searchtag="tags:"& tagname
Call Shell ("explorer.exe" & " " & searchlocation & "search-ms:query = searchtag", vbNormalFocus)
End Sub
What I want to be able to do to have a vba program that opens file explorer and searches by tags. but all I have been able to manage to figure out is how to open the file explorer using Shell. I have searched high and low on the internet trying to find anything that will specify searching by tags.
If I use the search bar on the file explorer I can search by tags by typing "tags:[tag name]"
I tried something like
Sub SearchTool()
Dim searchlocation As String
Dim tagname As String
Dim searchtag As String
searchlocation = \\my files
tagname = sheet1.Range("A1").Value
searchtag="tags:"& tagname
Call Shell ("explorer.exe" & " " & searchlocation & "search-ms:query = searchtag", vbNormalFocus)
End Sub