How does a computer get infected with malware via word document or note pad?

If you write something in the note pad or word document, how can it execute code. It shouldn't matter what is written in the note pad or word documents as its just a tool to write and display text.
8 answers 8