Opening an external non access folder from within access

G

Guest

I was wondering if anyone knows how you can use a command button to open a file or folder not related to access (eg having a command button on a form to open a word doc or a program folder). I am very new to access and would appreciate any info you may be able to give

Thank
Peter
 
A

Albert D. Kallal

You can place the following code behind a button to open any document as if
you clicked on it.


APPLICATION.FollowHyperlink "C:\AC.TXT"

or to open a word doc file you would use:

application.FollowHyperLink "c:\my documents\myResume.doc"

or Excel

application.FollowHyperLink "c:\my documents\myBudjet.xls"
 
D

dandgard

The code below will open an excel Spreadsheet, the same can be done fo
word or any other MS application in they all have an object in the M
world. To open other applications you may have to do somethin
different.

Dim xls As Excel.Application

Set xls = CreateObject("Excel.Application")
Set xlbook = xls.Workbooks.Open(NameandPathOfExcelSS)
Set xlsheet = xlbook.Worksheets(1)
'xls.Visible = Tru
 

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