Save to HTML / Load from HTML

<< Click to Display Table of Contents >>

Navigation:  Programming > Load & Save >

Save to HTML / Load from HTML

WPTools will create a HTML file if you save to a file with extension HTML or HTM.

To get the HTML code as a string use WPRichText1.AsANSIString('HTML');

 

'HTML' is a "format string" - please read more about this option strings here.

 

If your text containes embedded images you will need to save them to a file during the creation of the HTML code.

 

This FAQ shows how to do it: http://wpcubed.com/forum/viewtopic.php?t=1167

 

This FAQ shows how to load from HTML and include images: http://wpcubed.com/forum/viewtopic.php?t=1498

 

HTML is autotected when using the LoadFromFile or LoadFromStream methods. Images must be directly linked to local files. Otherwise the image must be loaded in the event OnRequestHTTPImage. (This event is also executed for images in RTF files which have not been embedded but just linked.) Also see this FAQ and the info about format strings.