Yes it's possible and the code I first posted does it (subject to changing .doc to .pub). It's not good code, just a quick edit of what you had for Word, but it works.

If you didn't even get the input box (nor an error) then the code can't have been running. Where did you put it and how did you try to run it?

I would still recommend you edit your places bar to make for simple directory switching rather than go this VBA route.