Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 2013 VBA ShellExecute,搜索框已初始化_Excel_Excel 2013_Vba - Fatal编程技术网

Excel 2013 VBA ShellExecute,搜索框已初始化

Excel 2013 VBA ShellExecute,搜索框已初始化,excel,excel-2013,vba,Excel,Excel 2013,Vba,使用以下代码: Option Explicit 'API declaration for the windows "Search Results" dialog Private Declare Function ShellSearch& Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, ByVal

使用以下代码:

Option Explicit 
 'API declaration for the windows "Search Results" dialog
Private Declare Function ShellSearch& Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long)

Private Const SW_SHOWNORMAL = 1


Sub ShowWindowsSearchDialog_API()
     '   Specified drive to Search
    Const szSDrive As String = "C:\"

    ShellSearch 0, "find", szSDrive, "", "", SW_SHOWNORMAL
End Sub
它会在浏览器中打开搜索对话框,我希望它只是桃色的

但是如何预初始化搜索参数?第四个选项应该是某种参数列表,但是我只能在MSDN上找到C++文档,而且它没有读过它是一个选项。我试过几种不同的方法,但似乎都不管用。我讨厌使用sendkeys之类的东西。甚至不确定sendkeys是否可以DTRT

谢谢你的帮助

一点附加信息:

由于各种不好的原因,一些报告被转储到一个混乱的文件夹层次结构中,但命名一致。所以我只想用explorer搜索,他们可以将它们控制到自己的工作文件夹中进行进一步处理