Opening external files with the OpenFile command (SOLVED)

My purpose here is to open external html files in htmlexe with the blacnk target set, and open it in a new window. This script calls for a seperate instance for every file that I want to open. Is that so?

Thanks in advance…

Hello,

I am attempting to use the OpenFile command on an external file not included in the compiled .exe.

I cant find any relevant documentation on the use of the command, so if you either point me to it, or paste the proper script, and how it should be linked here, it will be greatly appreciated.

Thanks in advance…

Use this code for instance:

procedure OpenAnExternalFile;
var
 EbookPath, MyProgram: String;
begin
 // Read the path to the folder that contains our ebook .exe
 EbookPath := GetGlobalVar("HEPublicationPath", "");
 // Construct the path to the file we want to launch.
 MyProgram := EbookPath + "myfile.doc";
 // Execute the program!
 if OpenFile(MyProgram, "",  SW_SHOWNORMAL) < 32 then
 begin
  MessageBox("Unable to execute the external file: " + MyProgram, "Ebook Error", MB_OK+MB_ICONERROR);
  exit;
 end;
end;  

Change “myfile.doc” to the filename you want.

For more info about inserting and using this script, see http://www.htmlexe.com/wiki/ExternalPrograms

Yes, this is the case. If you want to read external HTML files (outside the EXE), you’ll have to use HEScript too, but it’s a bit more complicate: you have to use the TStringList object (as explained in one of the samples of the doc) to load the external HTML file, then return the contents of the file to JavaScript so that it can be displayed.

Yes… I saw… ended up using the internal file manager to exclude all zips, rars, video, and the such.

I sorted by type. I nincludeded all my image and html files, but excluded everything I did not want in the pub. I alos used the opendirectory command and gave access to the individual directories for my end users…

Was not optimal for me, but it got the job done and I will tweak for better results…

Thanks