How do you open a word doc from inside access?

  • Thread starter Thread starter preheather123
  • Start date Start date
P

preheather123

I have a simple access database with one table. I would like to set up a
command button to open a word document and merge the data from a file into
the document. Anyone know how. I have been unable to find it in searches.
I have not had any training on VBA, macros, or modules.
 
Try putting the following code in the click event of your command
button:

Dim strPathAs String

strPath = "<complete path to the desired Word document>"

Application.FollowHyperlink strPath
 
Launching a word document and a merge system is quite easy in MS access.

However launching just one word Doc and with the one record that you're
viewing is a little bit more tricky.

I have step by step instructions on how to accomplish the above task, it
will require you to write about one line of code, and you should be able to
do this even with no programming experience at all.

The sample I have can be found here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

What is nice/interesting about my sample is that is specially designed to
enable ANY form with ONE LINE of code....

Thus, each time you build a new form, you can word merge enable it with
great ease.

Make sure you read the instructions from above, and you should eventually
get to the 7 page
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

you should be able to work your way through the steps outlined above.

Note that the merge can also use a query, and thus you don't have to merge
just "one" record..

After the merge occurs, you get a plain document WITHOUT any merge fields,
and this allows the end user to save, edit, or even email the document
(since the merge fields are gone after the merge occurs).

Give the above a try, I've had many users with no programming experienced
actually work their way through the above steps, and it did work for them.
 
You'll find a demo of various Access to Word automation operations, including
merging, at:


http://community.netscape.com/n/pfx/forum.aspx?msg=23781.1&nav=messages&webtag=ws-msdevapps


You should be able to lift the relevant code from it, so you'd just need to
create a Word template and a query in your database to return the data you
wish to merge.

Albert Kallal has a file which can be downloaded from:


http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html


I've not seen it, but its described by him as 'super easy'.


Ken Sheridan
Stafford, England
 
preheather123 said:
I have a simple access database with one table. I would like to set up a
command button to open a word document and merge the data from a file into
the document. Anyone know how. I have been unable to find it in searches.
I have not had any training on VBA, macros, or modules.
 
Back
Top