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!

Use VBA to control Word from Access?

Status
Not open for further replies.

dongledell

Technical User
Dec 10, 2002
26
GB
Hi, having a small problem and was suggested I come ask you guys.

In brief.... I have an Access 97 database and several mailmerged Word files that all reside in one directory on a PC sort of set up as a server. All users on the network can access this etc.

OK, now the boss wants me to make it so they can simply copy this entire directory onto any old PC he feels like for training people without dangering the data on the "real" database.

Problem is that all the Word files have to be told the path to the database, which means everytime he wants it moved onto a PC muggins here has to sit and go through them all, re-telling the documents where the database and table is.

So, question is, is there a way to do this automatically from Access? I've already coded to extract the directory path from the access 97 .Name function which works fine, now all I need to do is pass it to Word?!

Many Thanks
 
A way to solve that problem without changing anything in Access:

Assume the network path for the Word docs is K:\WordDocs

On the target machine create a Folder, C:\DriveK
Copy the WordDocs folder from K: to C:\DriveK

You now have C:\DriveK\WordDocs with a copy of all the documents

Create a DOS batch file on the target machine's desktop which contains the command :

Subst K: C:\DriveK

Run the batch file and ...

You now have a drive K: on the target machine.
 
'without dangering the data on the "real" database.'

What exactly are your Mailmerges doing then? Are they writing to the database?
 
Hi,

Many thanks for coming back to me.

I see where you are coming from, but the only problem is the people I work with wouldn't be able to do that (seriously - they all still struggle with the difference between the left and right mouse buttons....) and I need to find a solution that is possible "when I'm not there" as I dont intend to be very much - that's why I was looking to enable them to simply copy the dir. folder that contains the Database and Word files and paste them anywhere they wanted to - I think they can just about handle that!!!!!!!!!

Do you know if this is possible? I dont mind modding the Access file or if necessary the word files.

Many thanks.

 
lupins - the mailmerges themselves are not writing to the database, but some code that is run immediately after the mailmerges are completed do.

The comment on damaging the "real" data was more at the fact that many seem to like happy clicking while learing, changing radio buttons and the like without any realisation of how it can affect the data relevance!! thats primarily why we need to be able to train people "offline" of the real one so to speak!
 
Hey thanks Lupins46 - from the "look" of the code that would appear to be the sort of thing I'm after!!

I'll give it a thorough going over and see what I can do with it!

Many thanks - I'll let you know how it turns out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top