inserting text box content as a path statement when opening application

B

bozdog

Hi
I am currently designing an addition to an access 2000 application that
refers to the path of a specific external file, after a search is
performed.. I would like to know how to insert the result of said search as
the path statement when opening an external application.

i.e stAppName = "C:\program files\Windows
NT\Accessories\ImageVue\kodaking.exe (content of text box or qry here as
path)

Any help appreciated .

TIA
 
D

Douglas J. Steele

You can either concatenate the path to what you already have (making sure to
put quotes around it, in case there are embedded spaces) and use the Shell
command, or, assuming the file extension is associated with the application
you want to launch, you can just use the ShellExecute API call.

To use Shell, assuming your file is in strFile, you'd use something like:

Dim lngReturn As Long

lngReturn = Shell(Chr$(34) & strAppName & Chr$(34) & _
" " & Chr$(34) & strFile & Chr$(34))

(Chr$(34) is ")

To use ShellExecute, take a look at
http://www.mvps.org/access/api/api0018.htm at "The Access Web"
 

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