How to pass ctrl p in invoke code in uipath

Goal is to print page, in this case send hot key is not working or not supporting so finding alternative way to Ctrl P
looking for a or C# code for Ctrl P (print page) that can be used in invoke code activity.
Should work in back ground.

Hi @Ameya_Ghorpade,

What about using the Type Into activity, as bellow?


ā€œdā€ is for saying to press down the key mentioned within the brackets

Best regards,

If it is a webpage, try inserting JavaScript to the webpage with the following code.

function PrintPage(){
1 Like

tried this it failed in background


For VB, you could try SendKeys "^{P}"
Refer to

For C#, you could try SendKeys.Send("^{P}");
Refer to

Best regards,

p is lowercase, special is not selected

hresult e_fail returned from a call to a com component
Giving this error


give a try on send hot key:

it is important to use small case p. Using upper case P would result to following: CTRL+SHIFT+ā€œpā€

You should add the script as a function. I assumed you knew it. Check the updated answer.