When selling a Mac, it is best to do a CLEAN INSTALL and SECURELY ERASING the HDD/SSD you install the OS on in order to delete every trace of yours and make it impossible for the buyer to reconstruct/recover any of your data.
If you include MS Office, just give the buyer the CD and/or the registration code for the buyer to reinstall MS Office him/herself.
If you just want to sell the iMac with MS Office on there, but not giving the buyer the CD or the registration code, you could just send the buyer to an MS Office torrent, as that would be the same, as the buyer would not have the rights to own MS Office in that case and would have a problem, if the Mac HDD/SSD fails or in any other event the OS needs to be reinstalled.