Yes user defined function in qtp is possible. How we can do that. I will give you one small example. Being on qtp , click file-> new->test->"test". Test will be your file name. Next again...