macro runs automatically when specific document is opened

So I'm trying to get a macro to run when I open specific documents. I've made a macro that will check the doc name but how do I get it to run the check upon opening a document?