There are many reasons to why a corrupt MS Office document could attack your computer when it is opened. The first reason is Macros, which is typically coded in Visual Basic. The code of the macros could have malicious outcomes.
Although macros are majority of the time the cause for attack to occur from opening an MS Office document, there are other things as well. Another major attack vector from corrupt or malicious MS Office files are ".pst" files. PST files are files that contain archived calendar, messages, emails, etc. from MS Outlook. From just the name of the office product one can just guess what the attack vector is. The attack vector being that if a malicious email that had an internal malicious JavaScript, image, etc., was archived. Later opening up the ".pst" file and opening the email, it could start attacking the device that is opening the archived email in the ".pst" file.
Another attack vector (although old) is a malicious ".xll" file. A ".xll" file contains C, C++, ".dll", and FORTRAN executable code that could be malicious. A ".xll" file is considered by MS as a legacy Excel format now.
The last thing I can think off is a malicious ".maq" file that is used by MS Office. It is a regular shortcut, but when opened it can automatically run a query on a database preconfigured or specified in the query. If the query is malicious (ex. DROP DATABASE PASSWORDS), it will be attacking, or should I say modifying the data in the database machine/environment.