Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

startDocument Method

Receives notification of the beginning of a document. The reader invokes the startDocument method only once.

[Visual Basic]

The startDocument method is invoked before any other methods in the IVBSAXContentHandler interface or in the IVBSAXDTDHandler interface. Only the documentLocator property is invoked before the startDocument method.

Implementation Syntax

Sub startDocument()

Usage Syntax

oContentHandler.startDocument

Return Values

If failed, the ContentHandler raises a trappable error.

Example

The following example uses the startDocument method to set the text property for a text box (Text1) on the main application form (Form1). The new text indicates that the reader has begun reading the document.

Private Sub IVBSAXContentHandler_startDocument()
    Form1.Text1.Text = "Starting document." & vbCrLf
End Sub
[C/C++]

The startDocument method is invoked before any other methods in the ISAXContentHandler interface or in the ISAXDTDHandler interface, with the exception of the putDocumentLocator method.

Syntax

HRESULT startDocument();

Return Values

S_OK
The value returned if successful.
E_FAIL
The value returned if the parse operation should be aborted.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

documentLocator Property (Visual Basic) | endDocument Method | ISAXDTDHandler Interface | putDocumentLocator Method (C/C++)

Applies to: ISAXContentHandler/IVBSAXContentHandler Interface