How can I open a file with any extension through Clarion? I am able to save a file via FileDialog. But now I need to be able to open the file - preferably, without revealing the location of the file.
ShellExecute - for handcoders
Most of the time I use SHELLEX.TPL -Template from SterlingData - easy
What sort of âOPENâ do you have in mind?
If you mean OPEN a file inside of clarion?
then Use the DOS driver
If you mean
OPEN like double clicking on it in windows explorer
use ShellExcecute as Piet suggested
I was referring to just opening a file (like a Word document) saved on local or network.
I was able to figure it out by using a CapeSoft HyperActive Control. It was super easy.
Thanks.
If youâre using a later release of Clarion then the RUN command will open any file with the application thatâs associated with the file extension, so
RUN(âc:\yourFolder\yourFile.DOCXâ,1)
will open yourFile.DOCX with (by default) Word
Good to know. Thanks.
Thanks PBOUMA ii is now 4 jrs later and it still help people.
I battled with this specific uissue and got your download link.
Thanks a lot , make life so much easy.
You can call the Windows API function FindExecutableA() to check if there is a program registered to handle the File Extension for Open so you can show a nice message. Shell Execute will return the same No Association error.
I would not call RUN with (,1) to wait on something like a Word document that would cause your program to go Not Responding.
In my case using RUN with (,1) with a file ext which is not associated to a program, a windows dialog will be shown (fast) to choose a program for association. Not a bad idea i suppose