How to load external files from my ebook?

Hi,

Unfortunately, I am not an expert in scripting (programming). Therefore I do not know how to use the function “OpenFile”.

For my publication I chose the ExeViewer. I would like to open a word file (doc) which I have left as an external file. I do not know what to write into the script although I found the function within the reference.

Can you help me and give me an example?

Regards,
Feechen

You can use the script that is available at:
http://www.htmlexe.com/wiki/OpenFolder
But since you want to open a DOC file, just modify this line:

MyFolder := EbookPath + FolderName + "\";

to

MyFolder := EbookPath + "MYDOC.DOC";

and replace MYDOC.DOC with the filename of your DOC file. The DOC file must be in the same folder as your EXE file.

Hi,

I tried the script. Unfortunately, it does not work correctly. My word file is in a subdirectory (Word/Fragen/). I tried to include this, so I have the following code:

procedure OpenSubFolder(FolderName: String);
var
EbookPath, MyFolder: String;
begin
EbookPath := GetGlobalVar("HEPublicationPath", "");
MyFolder := EbookPath + "Word/Fragen/00_Einleitung.doc";
OpenFile(MyFolder, "", SW_SHOWNORMAL);
End;

The script starts word with an **empty **document named hefE70.doc. What is wrong?

Thanks for your help.

Regards,
Feechen

Hi,

I solved the problem! The code is correct:

procedure OpenSubFolder(FolderName: String);
var
EbookPath, MyFolder: String;
begin
EbookPath := GetGlobalVar("HEPublicationPath", "");
MyFolder := EbookPath + "Word/Fragen/00_Einleitung.doc";
OpenFile(MyFolder, "", SW_SHOWNORMAL);
End;

I forgot to edit the HTML code into this:

<a href="hescript://UserMain.OpenSubFolder">Open file 00_Einleitung.doc in folder Word/Fragen/</a>

Thank you very much! Now I can use my publication in the way I wish.

Regards,
Feechen

This topic was automatically closed after 24 hours. New replies are no longer allowed.