ShellExecute api

S

SF

I was trying to use the ShellExecute api which will allow you to open any
document with a registered executable found in
http://www.mvps.org/access/api/api0018.htm. I create a new module, copy the
code to it and attach

Private Sub cmdOpenDoc_Click
dim strSQL as String

strSQL = "'" & Me.DocLink & "'" 'Me.DocLink stores path to a file
fhandlefile(strSQL, win_normal)
end sub


From line above, I receive "Compile Error: Expected: ="

SF
 
B

Brendan Reynolds

You need either ...

Call fhandlefile(strSQL, win_normal)

.... or ...

fhandlefile strSQL, win_normal

.... or ...

Dim ReturnValue As Variant
....
ReturnValue = fhandlefile(strSQL, win_normal)

That is to say , when calling a function, you need to either use the Call
keyword as in the first example, or leave out the parentheses around the
parameter list as in the second example, or assign the return value of the
function to something (that's what the error message means when it says
'expected =').
 
S

SF

Hi,

I folow your suggestion. There is no error but when I click the bottun,
nothing happening

SF
 

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