ShellExecute api

  • Thread starter Thread starter SF
  • Start date Start date
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
 
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 =').
 
Hi,

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

SF
 
Back
Top