Interesting project.
You did not say how many contracts you have access to, but for sake of discussion I'm guessing 10,000 10-page documents.
There are several parts to this:
- Ingesting the contracts into a database.
- Breaking up each contract into "clauses", and indexing them
- Finding relevant clauses to be considered for the next contract
- Inserting clauses into the document
Re 1, I think importing into SQL Server is going to provide many benefits, so that will be my back-end database, while Access will be my front-end. Full Text Indexing will be enabled. This gives us superior querying to what Access can do (e.g. see Full-Text Search - SQL Server | Microsoft Learn).
Re 2, the traditional way is to have a human do this: bring up the next doc, indicate each clause, and enter keywords to index them. With 100K pages, that will take a long time. If we pay someone for a year, that will require 100k/2000 = 50 pages per hour, one page per minute. That feels tight but in the ballpark.
A tantalizing idea would be to use AI for this. Large Language Models are good at text processing. This is the bleeding edge of programming, but I would not discard it just yet.
Re 3, we can use the keywords to find the clauses, and we can use Full Text Index searches as well to find text in the contracts. Then a scoring algorithm would present them ranked by relevancy.
Re 4, using OLE Automation to interact with a Word document (better: the Word Object Model) to insert clauses is pretty straightforward, and more powerful than Mail-Merge which is really solving a different problem.
All in all, not something I would expect you could do on your own. This requires a seasoned professional developer.