How to open Word .doc?

  • Thread starter Thread starter MikeB
  • Start date Start date
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
 
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
 
Back
Top