05-26-2008, 01:22 PM
Code:
Set App=CreateObject("QuickTest.Application") ' Creating an Application Object
Set ORS=App.test.Actions("Action1").ObjectRepositories ' Get the Object repository collection of the Action called Action1
'**********************ASSOCIATING OR***********************
If ORS.find("C:\ObjectRepositoryfile.tsr")=-1 Then 'If the specified repository is not found in the Object Repository collection of Action1 then
ORS.add("C:\ObjectRepositoryfile.tsr") ' Associate this Shared Object Repository to the Object Collection of Action1
End If
'**********************DIASSOCIATING OR*********************
If ORS.find("C:\ObjectRepositoryfile.tsr")<>-1 Then 'If the specified repository is found in the Object Repository collection of Action1 then
ORS.Remove("C:\ObjectRepositoryfile.tsr") ' Remove this Shared Object Repository from the Object Collection of Action1
End If
Anil.