Word VBA - close doc and continue running macro
Posted on 2013-01-22
Hi fellow experts,
I'm creating a Word template that contains some VBA code wich should ultimately pass the document into a document management system. For that, the document template contains a button "Save in DMS". In order to pass the document to the DMS, the file must be in a closed state.
1. I'm unable link the button to code stored in the normal.dot. Is this possible? I can only link the button to code stored in the document template itself.
2. The handover process to the DMS requires the document to be closed. Even if I store the entire handover code in the document template, it will naturally stop as soon as I do a activedocument.close. I have tried the following: save button launches code in document, document calls code in normal.dot, that code in normal.dot closes the document and continues the handover to the DMS. This, too, does not work - as soon as the document is closed (by normal.dot's code), the whole program stops.
Is there a way I can either link a button in a document to code stored in normal.dot? And will this allow me to close the document and still continue running code? Or how else can I continue a process that was triggered by code in a document that gets closed during the process?
Thanks for your useful feedback.