title: Parsing XML tags using VBA
body: <p>I am trying to parse out specific "fields" in the XML sample below using VBA. For instance, I want to specifically parse the value from "Field1" and throw it into a variable. I'm having all sorts of trouble. </p>
  
  <p>Here's a bit of sample code:</p>
  
  <pre><code>Sub test()
  Set oXML = New MSXML2.DOMDocument      
  oXML.async = False
  oXML.validateOnParse = False
  oXML.Load ("C:\sample.xml")
  Set oXmlNodes = oXML.selectNodes("/")
  
  For Each oXmlNode In oXmlNodes
   Debug.Print oXmlNode.Text
  Next
  
  End Sub
  </code></pre>
  
  <p>And here's the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; 
  &lt;form&gt;
   &lt;metadata&gt;
   &lt;prop name="formName"&gt;
   &lt;value&gt;myTestForm&lt;/value&gt; 
   &lt;/prop&gt;
   &lt;prop name="formIdentifier"&gt;
   &lt;value&gt;0000033&lt;/value&gt; 
   &lt;/prop&gt;
   &lt;/metadata&gt;
   &lt;field name="field1" type="String"&gt;
   &lt;value&gt;something&lt;/value&gt; 
   &lt;/field&gt;
   &lt;field name="field2" type="String"&gt;
   &lt;value&gt;something else&lt;/value&gt; 
   &lt;/field&gt;
  &lt;/form&gt;
  </code></pre>