07-27-2010, 04:17 PM
Hi Sekhar,
You can add these objects using "Object Repository Manager" under "Resource" option if you want to prepare a shared object repository. Otherwise you can add these to Local Repository using "Object Repository" under "Resource" option. Then you can code according to your requirement using these objects.
If it still doesn't work then you can make use of shortcut key. For e.g. to open a new file, let say you type ALT+F and then O, then following code should help you,
You can learn more about sendkeys method in Help file of QTP.
You can add these objects using "Object Repository Manager" under "Resource" option if you want to prepare a shared object repository. Otherwise you can add these to Local Repository using "Object Repository" under "Resource" option. Then you can code according to your requirement using these objects.
If it still doesn't work then you can make use of shortcut key. For e.g. to open a new file, let say you type ALT+F and then O, then following code should help you,
Code:
set WshShell = CreateObject("WScript.Shell")
WshShell.sendkeys "%"+"F"+"O" (Here % is spl. character for ALT)
You can learn more about sendkeys method in Help file of QTP.