At our company there’s a pilot project using Documentum (DOC) as a document management system. From DOC, Word documents can be created based on our house-style templates. I’m told that for that purpose it’s necessary to import those templates into the DOC database. Handling documents created from DOC, through VBA code shows some strange behaviour every now and then. A little investigation shows that these documents, although the have a .doc extension, are in reality templates: ActiveDocument.Type returns the value 1, which stands for wdTypeTemplate. One of the things handled by VBA code is enabling/disabling buttons on custom commandbars that might be present in a template. Example: a button to remove a chunk of text is only enabled when there is something to remove. When closing, this could lead to a question like ‘The template has changed, do you want to save?’. In order to avoid that, these enabling/disabling actions are always followed by a line ActiveDocument.AttachedTemplate.Saved = True. But in case of these DOC files, being disguised templates, that also means that ActiveDocument.Saved is set to True… So I have a few questions:
1) Is importing the templates themselves in Documentum the right thing to do, or should that be fresh, empty documents based on the templates?
2) Could the fact that setting ActiveDocument.AttachedTemplate.Saved to True also sets ActiveDocument.Saved to True, lead to not saving such a document when the command ActiveDocument.Save is executed? It looks like this command doesn’t save the described DOC documents, but does save documents based on the same templates but created outside DOC.
3) If the answer to 2) is No, what else could cause the described behaviour?
4) Another weird thing (to me) is that Word sometimes seems to loose control over which document is the ActiveDocument. If I’m editing my code-only template and for testing purposes open another document, ? ActiveDocument.Name in the Immediate window returns the name of the code template instead of the name of the opened document. Activating that document and typing something and then repeating the command in the Immediate window still returns the name of the code template. Any explanation for this behaviour and, hopefully, a solution?
In order to exclude some possibillities, I already tried rebuilding the code template from scratch, exporting all modules and importing them into a new empty template.