Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and Replace Word document using Access database

Status
Not open for further replies.
Jul 16, 2002
9
US
Hello, I am in a bit of a jam here. Can anyone help me about creating a function (or a subroutine) in Access that will "Find and Replace" certain fields based from my Access table that is connected to a furnished Word document.

I originally wrote a code that will mail merge the Word document to the Access table. However since the report that is written in Word should reference data in Access that are located in two or more tables, I realized that Mail merge wont work since as far as I know, you can only use Mail Merge from Access with your Word Document if the document is based from one table only as its data source. Since I have more than one table that is related to each other (one to many tables), mail merging then wont work.

The other option is create a Find and Replace funtion. Question is how do I access this function in Access VBA?

Additional Info: The report is written in Word. And basically, the database is sort of like a questionaire (or survey) and depending on the answer, it should automatically fill in the data from the table(s) in Access to the Word document that serves like the template of a report. Again, mail merging wont work since data is derived from more than one table.

If there's a way to access Mail merge through code using Access VBA, how do you access the Find and Replace? Any source code you may share will be really appreciated. Thanks so much.
 
Additional Info:

By the way, the replacement data or info is based from a table in my Access database. Based from all the data in there, the code should be able to loop through this table, and based from the data in that row, replace all certain words in the Word document.

In other words, the replacement words that will be used should not be written down manually in the code but should depend on whatever is on the table(s).

Please advise. :S Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top