Skip Navigation LinksOneClickHelp > Programs and the interface description > Word 2 Help (doc to chm) > Additional opportunities > Fragment insert from an external file  

Fragment insert from an external file

It is often necessary to insert in Help fragments of the text which couldn't be inserted in the document. For example, sites where your program is placed often ask to insert the reference on them in html code:

<a href="http://www.windows7download.com/" target="_blank"><img src="http://www.windows7download.com/templates/w7d/images/awards/
windows7compatible.png" alt="Windows 7 Compatible - Windows 7 Download" border="0" width="160" height="80"/></a>

 

As a result it should be the image with reference on their site, but in Word it remains in html code. It can be bypassed. For creation of such property in Help it is necessary in MS Word.

1.     Define style
Name = Linki, it is based on Normal.

2.     Write in a place where such insertion should be words: Link1, Link2, etc.

3.     Style of these words Link1, Link2, etc. should be Linki.

4.     In file FolderName.txt defines these words as follows:

Link1=<a href="http://www.windows7download.com/" target="_blank"><img src="http://www.windows7download.com/templates/w7d/images/awards/
windows7compatible.png" alt="Windows 7 Compatible - Windows 7 Download" border="0" width="160" height="80"/></a>
Link2=<a href="http://www.suggestsoft.com/"> <img src="http://www.suggestsoft.com/scr/ads.gif" width=80 height=32 border="0" alt='Ads on SuggestSoft.com'> </a>

The numbers can be from 1 to 999, blanks are not supposed, after = also there are no blanks and all in one line.

You can see Example on the first page of the document 1ch-en.docx. If in FolderName.txt you write so Link7=file:///d:\example.txt instead of a word Link7 in Help file the content of example.txt will be inserted.

Thus it is possible to insert the line or contents of the whole file.

 

You can also write in the FolderName as so

Link2 = file:///FullPathYourFile

Link2Copy = FullPathFile

Link2Replacement = ThatSearch, ThatReplace

 

What will happen? While processing a page where Link2 is defined the file FullPathYourFile will be inserted. Then file FullPathFile will be copied to where an HTML page is stored. Finally in the HTML file phrase ThatSearch will be replaced with ThatReplace. Link2Copy and Link2Replacement can be defined as many times as you need.

 

BackHomeNext