In the propeties dialog double click in the 'onClick' event option. You will be shown options one of which is the Macro buider. If you select this the macro editor will be opened. Click in the left hand column and you will see a drop down box of all the macros available. Select the one called RunApp. At the bottom of the form you will see a text box called command line. Type in the full name and path of the document to open.
Alternately select the Code Builder option it will open the VB editor with a event handler stub. In the tools menu click on references and find the item which refers to MS Word, tick it then click OK. (the exact name varies depending on version installed).
Add the following to the stub
Dim WdApp as Word.Application
Set WdApp = getobject("Path\File.doc"
if WdApp is Nothing then
msgbox("Unable to open file"
exit sub
endif
important (depending on what you want to do)
WdApp.visible = true
If you use the second method you can write to the word doc from access, say to enter data from a table and can totaly control it from access. If you just want to read the file the macro is probably sufficient
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.