paths in shell call

B

bozdog

I am trying to use the contents of a text box on a form ,that returns the
path of a drawing file after a search, as the path for an application to
call after a button click.
The button works fine when I manually type the path string, but would like
to know how to place the string inside the text box, into the statement.

Typical Text box content ... "c:\agl\374-335.tif" (required path generated
from search)

stAppName = "C\kodakimg.exe (Path Here)
Call Shell(stAppName, 1)


TIA
 
D

Douglas J. Steele

You forgot the closing quote (and/or the space) between the executable and
the file, Arvin.

stAppName = "C\kodakimg.exe " & Chr(34) & Me.txtYourTextBox & Chr(34)

For those times when the path to the executable includes a space, you'll
need quotes then too, bozdog:

stAppName = Chr(34) & "C\Program Files\kodakimg.exe" & Chr(34) & " " &
Chr(34) & Me.txtYourTextBox & Chr(34)

(In case you're wondering, Chr(34) is equal to ")
 

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