1
votes

I've been experiencing some issues when trying to manually close a Word document created from my VBA project (actually developed with Access 2003). Depending on the method I use, it may prompt for saving Normal.dot and then tell me that it's already opened or being used. This is a little bit annoying, because I'm then unable to close Microsoft Word. A big waste of time.

1

1 Answers

6
votes

Some frustration later, I found a little trick to solve my issue. I've decided to post it there because I've been unable to find any information about this problem on Stack Overflow.

Here's how it goes:

Set WordApplication = CreateObject("Word.Application")
WordApplication.NormalTemplate.Saved = True

Nothing really fancy here, but the second line prevents the prompt for saving Normal.dot. It does NOT actually save anything to the template, it just let MS-Word believe it's been already saved.

Be sure that the option to prompt for saving Normal.dot is disabled in your MS Word's Preferences (Tools > Preferences > Save > Prompt to save Normal template). Disabling so will prevent the prompt in normal use situations. However, there might be some issue like the one above when you're creating a document from scratch with VBA (and probably many other languages), always depending on the method you implement to create/open your document.

Hopefully this little line will save you some more minutes of research.