In QTP under Tools/Options there is a setting to "Submit Defect to QC for each failed step". Set that. That will automatically create defects if steps fail. If you need to manually report a failure use:
With the defect option set, that will create defects when you manually create a failed point. you can also use:
This will fail a step as well and create a defect if the option is selected.
I hope this is what you were interested in.
Code:
Reporter.ReportEvent micFail, "Step", "ReasonWith the defect option set, that will create defects when you manually create a failed point. you can also use:
Code:
Services.SetTransactionStatus FailThis will fail a step as well and create a defect if the option is selected.
I hope this is what you were interested in.

