Hi
Thanks for reaching out to the HP Support Forums for a solution to your printing issue.
I understand that you are able to print from Notepad on your Windows 10 computer from an HP Officejet 5740 e-All-in-One Printer but unable to print from any other program. I would like to help with that.
This definitely seems like a software issue seeing how you have tested printer functionality by doing a scan, fax, and copy.
I would start by getting the printer connected the way you prefer to have it connected.
Next I would download and run the HP Print and Scan Doctor. This tool can diagnose and fix many printing and printer software issues.
Please let me know if this resolves the issue, or if you require further assistance.
In fact, if this helps you to reach a solution please click the "Accept as Solution", and the "thumbs up" buttons down below in this message.
Thanks!