Here's what I've used in the past in VBScript from QTP11 .. maybe it will be of some use.
pasting the code in has messed with the indenting, but it should still be legible.
Dim qcConn, GetCurrentTestScriptName, oResource, oFilter, oResourceList, oFile, qtApp, msg, oFile2
'Check to see if single quote used
If not (Left(resourceName,1)="'") and not (right(resourceName,1)="'") Then
' single quotes not used check to see if needed because space in name
If instr(resourceName," ") > 0 Then
' Add single quotes
resourceName= "'" & trim(resourceName) & "'"
Set qcConn = QCUtil.QCConnection
'Check to see if there is a QC connnection
If not(QCUtil.IsConnected) Then
Reporter.ReportEvent micFail, "QC Connection", "This test was stopped because a QC Connection is not working."
Set oResource = qcConn.QCResourceFactory
Set oFilter = oResource.Filter
oFilter.Filter("RSC_FILE_NAME") = resourceName
Set oResourceList = oFilter.NewList
If oResourceList.Count = 1 Then
Set oFile = oResourceList.Item(1)
oFile.DownloadResource saveTo, True
'Get data about this test for report
'Create the Application object
Set qtApp = CreateObject("QuickTest.Application")
GetCurrentTestScriptName = qtApp.Test.Name
GetCurrentTestScriptName= GetCurrentTestScriptName & " - " & qtApp.Test.Location
Set qtApp = Nothing ' Release the Application object
If oResourceList.Count = 0 Then
msg=" There no file named " & resourceName & " in ALM Resources"
msg=" ALM Resources has too many files with name " & resourceName
Reporter.ReportEvent micFail, "ALM Resource Issue", GetCurrentTestScriptName & "- Test " & sGetCurrentTestScriptName & " has following issue : " & msg
Set qcConn = Nothing
Set oResource = Nothing
Set oFilter = Nothing
Set oFile = Nothing