Shell Command Help

G

Guest

I've seen tons of references to the Shell Command. I've been to the
MVPS.org site with the shell command:
http://www.mvps.org/access/api/api0018.htm

I have no clue how to use it.

I have been using the following to open word documents:
Private Sub bxBB_Click()
Dim RCT As String
Dim oApp As Object
Dim objWord As Word.Application

Set objWord = CreateObject("Word.Application")

'Path to the word document
RCT = Application.CurrentProject.path & "\Documents\Board Briefing\Rate
Comparison Table.doc"

With objWord
.Visible = True
.Documents.Open (RCT)
.Activate
End With
End Sub

Now I'm trying to open a PDF file based on a selected region. I've got the
general lookup for it:
"\Documents\Maps\"&DLookup("[txtMapPath]","qryMaps")&".pdf"

For district 1 the path result is:
"\Documents\Maps\District_01.pdf"

I just don't know how to open it using the shell or any other method.

Can any one assist?
 
G

Guest

Hi,
you can just use the followhyperlink method e.g.:

Application.FollowHyperlink
"\Documents\Maps\"&DLookup("[txtMapPath]","qryMaps")&".pdf"

The followyperlink method opens any file in its associated program.
HTH
Good luck
 

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