PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Converts a Word Processing document into an HTML file.
Example
d is Document = "text.docx"
IF DocToHTML(d, "text.htm") THEN
Info("Document converted to HTML format")
END
// Exports the content of a Word Processing control to HTML
// Click code of "HTML export" button
DocToHTML(WP_MyDoc, fExeDir() + [fSep] + "wp.htm")
Syntax
<Result> = DocToHTML(<Document to convert> [, <Path>] [, <Managing the CSS styles>])
<Result>: Boolean or Buffer
  • If <Path> is specified:
    • True if the file was generated,
    • False otherwise. To find out the error details, use ErrorInfo.
  • If <Path> is not specified, <Result> corresponds to a buffer containing the HTML code.
<Document to convert>: Document variable or control name
Document to use. This document can correspond to:
  • a Document variable.
  • WINDEV a Word Processing control.
<Path>: Optional character string
Path of HTML file to generate. If the path is not specified, the HTML code is returned in buffer format.
<Managing the CSS styles>: Optional constant
Versions 24 and later
Style attributes to use:
dthWithCSS
(Default value)
Applies external CSS styles
The CSS code is generated in a ".CSS" file external to the HTML page. This file is created in the same directory as the generated HTML page. It has the same name as the HTML page, with the ".CSS" extension. A link to this file is added into the HTML code of the page.
If the document contains images, these ones are saved in a sub-directory named like the generated HTML file.
(default operation before version 24 Update 2)
dthWithoutCSSApplies inline CSS styles: the CSS code is generated and integrated into the HTML code of the generated page. Each tag contains the CSS styles applied to it.
If the document contains images, they are integrated and are encoded in base64.
This constant allows, for example, to create an HTML generation adapted to new email messaging.
Remark: if an image contained in an email is over 100 KB, it will be displayed as an attachment, even if it has been encoded in base64.
Parameter available from version 24 Update 2.
New in version 24
Style attributes to use:
dthWithCSS
(Default value)
Applies external CSS styles
The CSS code is generated in a ".CSS" file external to the HTML page. This file is created in the same directory as the generated HTML page. It has the same name as the HTML page, with the ".CSS" extension. A link to this file is added into the HTML code of the page.
If the document contains images, these ones are saved in a sub-directory named like the generated HTML file.
(default operation before version 24 Update 2)
dthWithoutCSSApplies inline CSS styles: the CSS code is generated and integrated into the HTML code of the generated page. Each tag contains the CSS styles applied to it.
If the document contains images, they are integrated and are encoded in base64.
This constant allows, for example, to create an HTML generation adapted to new email messaging.
Remark: if an image contained in an email is over 100 KB, it will be displayed as an attachment, even if it has been encoded in base64.
Parameter available from version 24 Update 2.
Style attributes to use:
dthWithCSS
(Default value)
Applies external CSS styles
The CSS code is generated in a ".CSS" file external to the HTML page. This file is created in the same directory as the generated HTML page. It has the same name as the HTML page, with the ".CSS" extension. A link to this file is added into the HTML code of the page.
If the document contains images, these ones are saved in a sub-directory named like the generated HTML file.
(default operation before version 24 Update 2)
dthWithoutCSSApplies inline CSS styles: the CSS code is generated and integrated into the HTML code of the generated page. Each tag contains the CSS styles applied to it.
If the document contains images, they are integrated and are encoded in base64.
This constant allows, for example, to create an HTML generation adapted to new email messaging.
Remark: if an image contained in an email is over 100 KB, it will be displayed as an attachment, even if it has been encoded in base64.
Parameter available from version 24 Update 2.
Remarks
If the document contains images, these ones are saved in a sub-directory named like the generated HTML file.
Business / GUI classification : GUI Code
Component : wd250mdl.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment