CreateXMLDOMFromFile (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Description
Create XML DOM object by loading it from a file. If file doesn’t exists returns Nothing.
Implementation
Public Function CreateXMLDOMFromFile(ByVal sFileName, ByVal boolAsync) Dim FSO, objXMLDoc Dim boolRC Set FSO = CreateObject("Scripting.FileSystemObject") boolRC = FSO.FileExists(sFileName) Set FSO = Nothing If Not boolRC Then Set CreateXMLDOMFromFile = Nothing Exit Function End If Set objXMLDoc = CreateObject("Microsoft.XMLDOM") objXMLDoc.async = boolAsync objXMLDoc.load(sFileName) Set CreateXMLDOMFromFile = objXMLDoc End Function