By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 2,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

Req help: How do I open a MS Word file from Access?

P: n/a
Hi all,

I created a button in an Access form that opens MS Word. Now I want
this button also to open a specific file. How do I code this?

Would it also be possible to let the user select the type of
template from a list? It would be perfect if this list does not
show the actual template files, but a short desribtion of the type
of file i.e.'report', 'proposal' etc.

Your help is much apprciated, Peppie (newbie)

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------

Sep 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Peppie" <rp*****@zonnet.nlwrote in message
<45***********************@news.tele2.nl>:
Hi all,

I created a button in an Access form that opens MS Word. Now I want
this button also to open a specific file. How do I code this?

Would it also be possible to let the user select the type of
template from a list? It would be perfect if this list does not
show the actual template files, but a short desribtion of the type
of file i.e.'report', 'proposal' etc.

Your help is much apprciated, Peppie (newbie)

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------
Depending on how/what you wish to to, there are several possibilities.

One is this wrapper for the ShellExecute API
http://www.mvps.org/access/api/api0018.htm

If you create a table containing your descriptions, and the file names,
you could use a combo or list on the form to allow the users to select
based on the description, but then use the file name when opening
Word.

--
Roy-Vidar
Sep 9 '06 #2

P: n/a
or you could be lazy and format the path as a hyperlink, and Word
would open it if the registry says to open doc files with Word...

Sep 9 '06 #3

P: n/a
I created a button in an Access form that opens MS Word. Now I want
this button also to open a specific file. How do I code this?
Just the following code:

application.FollowHyperlink "c:\mydcocs\bill.doc"

You can open any file using the above...(excel, pdf etc.).
Would it also be possible to let the user select the type of
template from a list? It would be perfect if this list does not
show the actual template files, but a short desribtion of the type
of file i.e.'report', 'proposal' etc.
I have a working sample that automatically builds a list of word docs into a
lsit box, and lets you merge the CURRENT ONE record to the word document.
This is ideal for templates in applications. Further, my code allows you to
word-enable any form with ONE LINE of code, and it automatically handles the
template generation, and also selects the ONE record for you..

You can find this here:

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

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Sep 9 '06 #4

P: n/a
The solution that you offered was really helpfull.

Thanks, Peppie

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------

Sep 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.