I am using automation to manipulate Word from an Access database. The database has a function that will generate routine correspondence by merging information from the record into a template. The process takes a couple of seconds, during which time the letter is merged to a new document and then original template is closed and the new document is saved and its location and filename written back to the database.
The document template is shared and resides on the server, and the problem comes when two people try to access the template at the same time (during that 5-8 second window while the template is open) and the “This document is locked for editing by another user…” dialogue appears. Is there a way for me to check whether or not the document is already open in the VB code and hence side-step this?
thanks,
Karl