Inserting Files with HTML Passthrough Code


Please note: The “Passthrough HTML” feature is still available in Doc-To-Help, but it is recommended that you make use of the Rich Text Variables feature instead. With this feature, you can define a variable in an HTML document and insert it into a Word document.

By using the HTML passthrough feature and the CopyFolder property you can insert files (like animated gifs or Excel spreadsheets) directly into your Help target. The CopyFolder property allows you to define a folder to store linked files when using HTML passthrough code.

Note: HTML Passthrough code is an advanced feature used in Word documents only. HTML Passthrough code should only be used on the rare occasion when it is necessary to insert HTML code into a Word document, and an HTML source document cannot be used for this purpose.

To define a CopyFolder:

1.   Open the HTMLHelp folder that Doc-To-Help created when you first built your HTML Help target.

2.   Create a sub-folder within the HTMLHelp folder.

In this example, we will use Media as the name of the folder.

Note:   In this example, we placed this CopyFolder within the HTMLHelp folder, but there is no limitation on the location of a CopyFolder. It is a good practice though, to keep the CopyFolder within the Doc-To-Help project folder or Help target folder.

3.   Save the files you want to insert using HTML passthrough to the media folder.

4.   From the Doc-To-Help project editor, select Project from the Icon Bar.

5.   Select the Help Targets item in the left hand pane.

4.   Select the HTML Help target from the right pane.

5.   From the Property Pane, select the CopyFolder property and type the following into the right cell:


To set HTML code as passthrough:

1.   Select the location for your HTML code and type it directly into your source document.

For Example:

<img src="MyAnimatedGif.gif">

<a href="MyExcelSpreadsheet.xls">

Even though you have saved the file you want to insert to a sub-folder under your HTMLHelp folder, you do not need to include a path statement in your tag. This is because you set the CopyFolder property. The file will now be automatically be copied to the HTMLHelp Folder.

Note:  Make sure that Word smart quotes are turned off so that straight quotes are included in the tags.

2.   Select the HTML code and click the Conditional Text button  on the D2HML Styles toolbar.

3.   From the Condition window, select the HTML based platform of your choice and check the HTML passthrough code checkbox.

4.   Rebuild your HTML Help target and check your help file for the inserted file.

For more information, see Using the HTML Passthrough Code Option.