?
Solved

Search directory with Word documents for docs containing a word from Access 2007

Posted on 2011-09-19
8
Medium Priority
?
310 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:dgravitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 12

Expert Comment

by:danishani
ID: 36561211
Check this demo out (see attached).
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
0
 
LVL 12

Expert Comment

by:danishani
ID: 36561342
Newer version, with better releasing of the Objects and releasing the WINWORD.EXE instance from memory.

 SaveWordDoc-v2.zip

Hope this helps,
Daniel
0
 

Author Comment

by:dgravitt
ID: 36561613
Not sure I understand where to insert the directory name where the files are located.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 12

Expert Comment

by:danishani
ID: 36561966
Below new demo, including the option on Form to change Directory and option Incl. SubDir.

 SaveWordDoc-v3.zip

Hope this helps,
Daniel
0
 

Author Comment

by:dgravitt
ID: 36562116
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.
0
 

Author Comment

by:dgravitt
ID: 36562231
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.
0
 
LVL 12

Accepted Solution

by:
danishani earned 2000 total points
ID: 36562340
I think I released the Object to early, so adjusted the code a little.
See attached.

 SaveWordDoc-v4.zip
0
 

Author Closing Comment

by:dgravitt
ID: 36562450
Great solution. Thanks
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question