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 Vb.net 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,
Marius
If it is a webpage, try inserting JavaScript to the webpage with the following code.
function PrintPage(){
window.print();
}
tried this it failed in background
For VB, you could try SendKeys ā^{P}ā
Refer to https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/sendkeys-statement
For C#, you could try SendKeys.Send(ā^{P}ā);
Refer to https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys.send?view=net-5.0
Best regards,
Marius
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.