dgravitt
asked on
Search directory with Word documents for docs containing a word from Access 2007
From Access 2007, I would like to search a directory containing Word documnets and find documents that contain a specific word in the body, then write that file name to a table.
Newer version, with better releasing of the Objects and releasing the WINWORD.EXE instance from memory.
SaveWordDoc-v2.zip
Hope this helps,
Daniel
SaveWordDoc-v2.zip
Hope this helps,
Daniel
ASKER
Not sure I understand where to insert the directory name where the files are located.
Below new demo, including the option on Form to change Directory and option Incl. SubDir.
SaveWordDoc-v3.zip
Hope this helps,
Daniel
SaveWordDoc-v3.zip
Hope this helps,
Daniel
ASKER
This is going to work great. But, I'm getting an error 3420: Object invalid or no longer set. Seems like it is occuring after finding the first file. I only have one record written to the table.
ASKER
Sometimes, before getting the error above, I get a warning this file is locked for editing. I presume it is on the next file found that meets the search criteria. The machine name is my PC that it says has the file locked.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great solution. Thanks
SaveWordDoc.zip
Set References to Microsoft Script Runtime and Microsoft Word 12.0 Object.
Make sure you change the Pathname accordingly in the OnClick Event of the Command button.
Post back with questions.
Hope this helps,
Daniel