title: Open file dialog to select XML file
body: <p>I have a VBScript that selects a file from the c: drive and gets the information from a tag on a XML file but I want the user to be able to select the file from a dialog but I cant seem to get it done, here is my script:</p>
  
  <pre><code>Dim xmlDoc, objNodeList, plot, fin
  
  Set xmlDoc = CreateObject("Msxml2.DOMDocument")
  xmlDoc.load("C:\Users\User\Documents\vbscript\mlb.xml")
  Set objNodeList = xmlDoc.getElementsByTagName("league")
  
  
  Set objFSO=CreateObject("Scripting.FileSystemObject")
  
  ' Create file
  outFile= "C:\Users\User\Documents\vbscript\Leagues.txt"
  Set objFile = objFSO.CreateTextFile(outFile,True)
  
  
  
  If objNodeList.length &gt; 0 then
  For each x in objNodeList
  plot= x.getAttribute("name")
  
  'Write to File
  objFile.Write plot &amp; vbCrLf
  
  Next
  Else
  msgbox " field not found."
  End If
  
  objFile.Close
  </code></pre>
  
  <p>any help would be appreciated.</p>