How to open Word .doc?

M

MikeB

Is it possible to create a form button and open a MS Word .doc?

If have found how to open a Excel Spreadsheet but not a Word doc.

If this is possilbe what code do I need behind the button on the OnClick.

Thanks for the help,
MikeB
 
D

Dirk Goldgar

MikeB said:
Is it possible to create a form button and open a MS Word .doc?

If have found how to open a Excel Spreadsheet but not a Word doc.

If this is possilbe what code do I need behind the button on the
OnClick.

Thanks for the help,
MikeB

There are a number of ways to do this. Assuming that Word is the
application associated with the .doc extension, you can use
Application.FollowHyperlink to do it. For example

'----- start of example code -----
Private Sub cmdOpenWordDoc_Click()

Application.FollowHyperlink "C:\My Path\MyFile.doc"

End Sub
'----- end of example code -----

If the path to the file is held in a control, use a reference to that
control's value instead:

Application.FollowHyperlink Me!PathToWordDoc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top