Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Acrobat Reader From VFP6.0 EXE 1

Status
Not open for further replies.

spayne

Programmer
Feb 13, 2001
157
US
I am updating an application we offer our clients that allows them to browse test results we send them. We have recently begun exporting some of our reports in PDF format. I want this application to open Reader along with the file. I have developed code to do this provided I know the full path and the name of the program. The problem is, I don't know what version of Reader any of our clients are using. Right now I am doing this:

llAcrobat = .F.
IF FILE(default path to Acrobat 5.0)
lcApp = default path to Acrobat 5.0
llAcrobat = .T.
ENDIF
IF FILE(default path to Acrobat 4.0)
lcApp = default path to Acrobat 4.0
llAcrobat = .T.
ENDIF

IF llAcrobat
Code to display PDF
ENDIF

Obviously, I don't have all the paths to each version. Is there an easier way to do this, or how can I get as many paths as possible?

I should add, most of these clients aren't too computer literate. Just telling them they need to upgrade to 5.0 will just frustrate some of them and they won't use the app at all.

Thanks in Advance,
Steve
 
Steve,
You maybe over-thinking this one. Try:
Code:
declare INTEGER ShellExecute in shell32 ;
  INTEGER handle, STRING @ oper, STRING @ ifile,;
  STRING @ iparam, STRING @ ipath, INTEGER showcmd

=shellexecute(0,"open",filename,"",startupdirectory,1)
where:

filename = the full name and path of the file
e.g. c:\document1.pdf
startupdirectory is the "start in" directory you get with shortcuts
e.g. c:\ (normally the justpath() of filename)

Rick
 
I am using the same ShellExecute command. It works. It'll open any file type with the default program associated with that particular file type.
 
Thanks Rick. Works great. But it's hard to overlook something you don't know about! Where can I learn more about what this ShellExecute command can do?
 
Do a search for shell*.chm on your computer. I've got a couple of versions of shellcc.chm on my computer which gives a lot of information about ShellExecute if you search on the name in it. Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top