我有許多組織,每個組織的列表。有數百人的列表,每個人在該組織文件夾中都有一個scan'd文檔,現在我的應用程序打開了org文件夾,並且用戶正在搜索該用戶,但用戶希望btn打開Windows資源管理器自動搜索一個人。搜索文件與Windows資源管理器
,我發現這個代碼:
Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & <variable> & "&crumb=location:<your search location>%", vbNormalFocus)
但Windows提出如下因素的錯誤:
Windows Cant find ". Check if spaled correctly...
有什麼建議?
我在這裏添加我的代碼:
Private Sub cmdView_Click()
Dim strPath As String
strPath = CurrentProject.Path & "\Scans\" & DLookup("OrgName", "tblOrganizations", "ID=" & Me.OrgID)
'Shell "C:\WINDOWS\explorer.exe """ & strPath & "", vbNormalFocus
Call Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & Me.Phone & "&crumb=location:" & strPath & "%""", vbNormalFocus)
End Sub
我想你錯過了另一個雙引號的地方......最有可能在你的命令結束。不要忘記逃避它。 – parakmiakos 2014-08-28 06:33:36
謝謝,我會試着弄清楚 – 2014-08-28 15:01:33
是的,你在explorer.exe後面有一個開頭轉義(加倍)報價,並且在最後沒有關閉。 – 2017-01-20 01:33:18