473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
4 1648
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Otis Hunter | last post by:
I have been given an Access Database which contains a table that has an OLE object field that contains a Word document. That table contains hundreds of records. I would like to find out how I can...
4
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring...
0
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring...
8
by: lltaylor | last post by:
Hello, I have an application that I use to scan through some word documents. I have successfully managed to get my app, to open the relevant documents and usings Word's find function, find the...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
7
by: Niyazi | last post by:
Hi, I am developing small insurance application using VB.NET and SQL server 2000. My tables in SQL server are: tbl_Customer (stores the custmer information) tbl_CustImage ...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
9
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.