output Property
Determines the output for MXXMLWriter
. By default, the output
property is a BSTR (string) value. You can also set this property to any implementation of the IStream
interface, and the resulting document will be written into the provided IStream
. Setting this property to the empty value (VT_EMPTY or " ") will return output to the internal string and reset it.
Usage Syntax
oMXXMLWriter.output = varDestination varDestination = oMXXMLWriter.output
Remarks
Read/write. Variant destination.
Example
For elements such as <script>
and <style>
, MXHTMLWriter
passes through special characters. In the following example, MXHTMLWriter
passes through the "<" character as a literal within the <script>
tags.
Dim wrt As New MXHTMLWriter50 Dim cnth As IVBSAXContentHandler Dim atrs As New SAXAttributes50 Set cnth = wrt cnth.startDocument cnth.startElement "", "", "html", atrs cnth.startElement "", "", "script", atrs cnth.characters "var a = 0;" cnth.characters "var b = 1;" cnth.characters "if (a < b) alert('hello')" cnth.endElement "", "", "script" cnth.startElement "", "", "body", atrs wrt.disableOutputEscaping = True cnth.characters "Sample HTML Page" wrt.disableOutputEscaping = False cnth.endElement "", "", "body" cnth.endElement "", "", "html" MsgBox wrt.output
Example Output
<html><script>var a = 0;var b = 1;if (a < b) alert('hello')</script><body>Sample HTML Page</body></html>
Syntax
[propput] HRESULT output ( [in] VARIANT varDestination);
[propget] HRESULT output ( [out, retval] VARIANT * varDestination);
Parameters
- varDestination
- The variant destination.
Return Values
- S_OK
- The value returned if no errors are reported.
Remarks
The default is VT_EMPTY to output to string.
To view reference material for Visual Basic or C++ only, click the Language Filter button in the upper-left corner of the page.
See Also
IMXWriter Interface | MXXMLWriter CoClass
Applies to: MXHTMLWriter CoClass