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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Word Document by way of a command button 3

Status
Not open for further replies.

Simon22

Technical User
Feb 1, 2001
54
CA
Hi all,
I've found out how to open MS Word with a command button but I would like to know how to open a specific MS Word file with a command button or macro. I don't want it to open as a part of Access though.

Also, while I'm at it, can anyone explain to me how to run the MS Word mail merge function from Access?

Thanks
 
See if this helps.

faq181-432
Dave
gallagherd@earthlink.net
 
You'll want to create an unbound command button on your form, (wizard off). Then go to the properties of the button and there is a property called Hyperlink Address. Type in the Path name for the file, or click on the build button (button with 3 dots at end of box). A Hyperlink window will come up and you can browse for the file, then click ok. Go to Form View and click on button. Word will launch and the file will open.

What is it that you want to know about mail merge in Access? It does work wonderfully....I like it better than working directly from Word. Probably the easiest way is to select the Tools menu from the main DB window and go to Office Links, then Merge it with Word. From there, just follow the wizards steps. (You also have a button on your toolbar with a big W on it, called Office Links)

Good Luck,
CindiN
 
Is there any way to add the word document to the hyperlink wiithou thaving to open it up within design view.

SO the user will click on the button and "attach" the file to the record and when next clicked the word document will open?
 
To create a button that will allow users to link and display an image or other (type of file) on a form and allow you to open the file for editing.

1) Create a field with type OLE in your table called "document".

2) On your form create a bound OLE frame called "OLEBound1" its control source should be the table field "document".

3) On your form create a command button with the following code in the on click event...

Private Sub Command1_Click()
DoCmd.GoToControl "OLEBound1"
DoCmd.RunCommand acCmdInsertObject
End Sub

This will open the insert object dialog and allow you to browse to locate the picture file.

You will have to decide whether to "Link" (store only the path to the file) or "Embed" (store the entire file in the database). Generally you will want to link as this keeps the size of the database down and ensures that you view the latest version of the graphics file). With linking however if the file is deleted then you wont be able to see it in your database anymore.

You will also want to look at the properties for the ole frame to have it apear and behave the way you want.

Key properties are:

Display Type - Content shows the actual picture as opposed to an icon.

Size Mode - You probably want "zoom" or "stretch"

Autoactivate - if set to "double click" allows you to open the file in the native application for viewing and editing by double clicking the frame on the form.
Dave
gallagherd@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top