If you keep that file in TextEdit (Mac) or some other simple editor, rather than Word, it won't mess with the apostrophes and quotations marks, and they should work all the time.
Word uses "smart quotes" wherein open and close quotes are different symbols, which fucks things up when you're coding. You can turn that off in the preferences, but then your Word text won't look as nice.