So when I use the code below with no word document open, I get a 0. So far so good. I open one word document and I get a 1. Up to here, all fine.
But when I close the