How to load external files from my ebook?

Status
Not open for further replies.

feechen

New member
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
 
Last edited:
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:
Code:
MyFolder := EbookPath + FolderName + "\";
to
Code:
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.
 
Last edited:
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:
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
 
Last edited:
Hi,

I solved the problem! The code is correct:
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;
I forgot to edit the HTML code into this:
Code:
<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
 
Last edited:
Status
Not open for further replies.
Back
Top