Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Suffolk, United Kingdom
    Thanked 0 Times in 0 Posts
    Hi Everyone,

    I am looking for a way to open a few thousand letters in preset locations, all have a 6 digit file name. and scan the letter for a specific date then scan the letter for specific keywords before reaching the next page.

    I have a table with all the 6 digit filenames I am interested in searching, some of the files have more than 100 pages. I would like to do this from access, if the search returns a true value i.e. a keyword was found, then I want to update a column in the table with the 6 digit numbers with a true value.

    I was thinking I could use a loop statement with application.followhyperlink strPath to cycle through the letters, however, I am lost with how to then search the document for a start point and the search for keywords. It would be worth noting that if the specific start date can not be found it should update the same column in the source table with 'NO LETTER FOUND ON SPECIFIC DATE'

    Kind Regards
    Gerbil (AKA Kevin)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts
    You should start Word from Access using code, then use Word VBA to open and search the documents. Controlling one application from another using code is called Automation. You'll find a general introduction with useful links in WendellB's tutorial Automation 101.

    There are many examples in the Word forum of the code needed to loop through documents in a folder and to process them, for example my reply in Find and Replace Macro for Figure Title Field Code (MS Word 2003).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts