title: Getting Error as 'User defined type not defined' in the code
body: <p>Greetings for the day,</p>
  
  <p>Hi, I am a beginner using vb 6.0. I am using the following code and getting 'user defined type not defined'.the code is below.the line where i get error is highlighted.Kindly help.should i add some references or components?if so,what it would be. your timely and kindly help will be much more helpful for me</p>
  
  <pre><code>Public Sub LoadDocument() 
      Dim xDoc As MSXML2.DOMDocument
      Set xDoc = New MSXML2.DOMDocument 
      xDoc.async = False 
      xDoc.validateOnParse = False
      If xDoc.Load("C:\Users\284582\Desktop\XML1.xml") Then
              DisplayNode xDoc.ChildNodes, 0 
      End If 
  End Sub    
  
  ' Error on this line'
  Public Sub DisplayNode(ByRef Nodes As MSXML.IXMLDOMNodeList, _
             ByVal Indent As Integer)    
  
      Dim xNode As MSXML.IXMLDOMNode
      Indent = Indent + 2    
      For Each xNode In Nodes
          If xNode.NodeType = NODE_TEXT Then
  
              Debug.Print Space$(Indent) &amp; xNode.ParentNode.nodeName &amp; _
                  ":" &amp; xNode.NodeValue 
          End If    
  
          If xNode.HasChildNodes Then   
              DisplayNode xNode.ChildNodes, Indent  
          End If    
      Next xNode   
  End sub    
  </code></pre>