The facility to save versions of a document in a single file was removed in Office 2007.
See the article "How to save a document using a filename that gets incremented by 1 each time if the filename already exists” at:
You will probably want to change the extension of the file in the code from "doc" to "docx"
Did this resolve your issue?
Sorry this didn't help.