Sets whether to indent output. When set to True, this property requires output to be indented (or "pretty printed") to reflect the nesting structure of the document.
oMXXMLWriter.indent = boolValue boolValue = oMXXMLWriter.indent
Boolean. Read/write. The general rules of indentation are: XML headers and root elements start on a new line with a zero indent; element content, including leading and trailing white spaces, is not changed in any way.
The following example creates a simple HTML document and indents it for "pretty-printing."
Dim wrt As New MXHTMLWriter50 Dim cnth As IVBSAXContentHandler Dim atrs As New SAXAttributes50 Set cnth = wrt wrt.indent = True cnth.startDocument cnth.startElement "", "", "html", atrs cnth.startElement "", "", "body", atrs cnth.characters "This is a test" cnth.endElement "", "", "body" cnth.endElement "", "", "html" MsgBox wrt.output
Results
<html> <body>This is a test </body> </html>
[propput] HRESULT indent ( [in] VARIANT_BOOL fIndentMode);
[propget] HRESULT indent ( [out, retval] VARIANT_BOOL * fIndentMode);
The default of this property depends on the implementation. The general rules of indentation are: XML headers and root elements start on a new line with a zero indent; element content, including leading and trailing white spaces, is not changed in any way.
To view reference material for Visual Basic or C++ only, click the Language Filter button in the upper-left corner of the page.
IMXWriter Interface | MXXMLWriter CoClass
Applies to: MXHTMLWriter CoClass