Computer Viruses

Can a keystroke program be placed on a computer through an email with an attachment that is downloaded?

012