If you are using VB ( i guess so )... use
SendKeys "{F1}" in your code

Pradeep