This is taken from the UFT AOM (Automation Object Model). It is code to change run results (and is modified to use a variable, which is what you're asking for). You probably don't need all of the settings shown in the below code, but they are included just in case (you'll most likely only need the first few lines which deal with the results). Hope this helps.
++++++++++++++++++++++++++++++++++++
Code:
myResultsLocation = ''C:TestsTest1Res1''
Set qtResultsOpt = CreateObject(''QuickTest.RunResultsOptions'') ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = myResultsLocation ' Set the results location
Set qtAutoExportResultsOpts = qtApp.Options.Run.AutoExportReportConfig
qtAutoExportResultsOpts.AutoExportResults = True ' Instruct UFT to automatically export the run results at the end of each run session
qtAutoExportResultsOpts.StepDetailsReport = True ' Instruct UFT to automatically export the step details part of the run results at the end of each run session
qtAutoExportResultsOpts.DataTableReport = True ' Instruct UFT to automatically export the data table part of the run results at the end of each run session
qtAutoExportResultsOpts.LogTrackingReport = True ' Instruct UFT to automatically export the log tracking part of the run results at the end of each run session
qtAutoExportResultsOpts.ScreenRecorderReport = True ' Instruct UFT to automatically export the screen recorder part of the run results at the end of each run session
qtAutoExportResultsOpts.SystemMonitorReport = False ' Instruct UFT not to automatically export the system monitor part of the run results at the end of each run session
qtAutoExportResultsOpts.ExportLocation = ''C:Documents and SettingsAll UsersDesktop'' 'Instruct UFT to automatically export the run results to the Desktop at the end of each run session
qtAutoExportResultsOpts.UserDefinedXSL = ''C:Documents and SettingsAll UsersDesktopMyCustXSL.xsl'' ' Specify the customized XSL file when exporting the run results data
qtAutoExportResultsOpts.StepDetailsReportFormat = ''UserDefined'' ' Instruct UFT to use a customized XSL file when exporting the run results data
qtAutoExportResultsOpts.ExportForFailedRunsOnly = True ' Instruct UFT to automatically export run results only for failed runs