我有一个代码可以访问特定文件夹中的关键字我需要一个代码以在访问中显示Windows资源管理器搜索结果

问题描述

enter image description here

我已经编写了Access VBA代码,以在指定文件夹中的PDF内容中搜索字符串。代码已成功执行,并显示具有搜索字符串的PDF文件。最终结果显示在窗口中,但是我试图在MS Access中显示这些搜索结果。

Private Sub TDSearchButton_Click()
'Variable Declaration
    Dim KeyWord As String
    Dim sFilePath As String
    Dim sFileName As String
    Dim FileLocation As String
    Dim SearchPath As String
    Dim SearchLocation As String
    
    
        'Checking for the null value of the KeyWord
        KeyWord = Nz(Form_TechnicalDocumentFrm.TDKeywordBox.Value,"")
        'Caution for user to enter the keyword to search
        If KeyWord <> "" Then
            MsgBox "Wait for the results"
        Else
            MsgBox "Please Enter the Keyword to start Search",vbOKOnly
            Exit Sub
        End If
        
        'Specify File Path and keyword to search
        sFilePath = "\\hyrrfs01\proj_hyrrin\999-1076\1project_directives_and_customer_supplied_product\AIGR\Database\SS"
        FileLocation = "Explorer.exe " + sFilePath
        SearchPath = "search-ms:displayname=" & KeyWord & "%20Results%20&crumb=System.Generic.String%3A"
        SearchLocation = "&crumb=location:\\hyrrfs01\proj_hyrrin\999-1076\1project_directives_and_customer_supplied_product\AIGR\Database\SS"
        
        'Calling for Shell command to do search of keyword
        Call Shell("explorer.exe """ & SearchPath & KeyWord & SearchLocation & "",1)
End Sub

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...