View Full Version : Search word documents within Access
Hello,
I have an Access Database that holds many word documents. I would like to be able to search for specific words within the documents. How would I do that?
CreganTur
05-04-2009, 11:53 AM
I have an Access Database that holds many word documents.
How are they held within the database? OLE objects, hyperlinks, etc?
Here's the code for the onClick in the form. Does this help?
Private Sub LstDocuments_Click()
On Error GoTo Err_Handler
Screen.MousePointer = 11
'Dim WordApp As Object
'Set WordApp = CreateObject("Word.Basic")
With rstDocs
.MoveFirst
Do While Not .EOF
If !ProcedureNumber = LstDocuments.Value Then
DocName = "\\oaitsd\ISFILE\Technology (file://\\oaitsd\ISFILE\Technology) Services\SDC\Operations\" & rstDocs!FileName
' Set a reference to the Word Application object.
Dim WordApp As Word.Application
Set WordApp = New Word.Application
WordApp.Visible = True
WordApp.Documents.Open DocName
Exit Do
End If
.MoveNext
Loop
End With
Screen.MousePointer = 0
Exit Sub
Err_Handler:
If Err.Number = 5174 Then
Dim response As String
response = MsgBox("The file you request does not exist.", vbOKOnly, "User Notification Screen")
Else
MsgBox Err.Description
End If
Screen.MousePointer = 0
WordApp.Quit
Debug.Print Err.Number
Debug.Print Err.Description
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.