1
votes

Using Win10 and Word 2016.

I have made a Word template with macros (.dotm). When I create a new document (.docm) based on this template all the code (except ThisDocument) is copied from the template to the document.

But these macros are not visible in Word when i reopen the document: I open the macro-window (alt+F8) and if I in the list at the bottom choose the active document (not 'All...' or the template) none macros are shown. The macrolist is empty.

The shortcuts to the macros doesn't work either.

But if I create a new macro and go back to the macro-window (alt+F8) all the macros are there as they should be. And the shortcuts work.

Why does this happen? And more important: How can I make sure that the macros are visible and the shortcuts work immediately when someone opens the document?

1
It was better you could attach the original file so we could try and see what happens, but make sure that your template and created instances have the same object (Document) name. Object names in different languages are shown differently and macros may be disabled if you create an instance. Another thing is to avoid using Active x controls and use shapes instead. Right click on shapes and assign macro. Active x controls get corrupted easily.Ibo
Thank you for your input. The code get copied using this code: Dim arrAllKode arrAllKode = Array([Name of all forms & subs]) For Each Item In arrAllKode On Error Resume Next Application.OrganizerCopy _ Source:=ActiveDocument.AttachedTemplate.FullName, _ Destination:=ActiveDocument.FullName, _ Name:=Item, _ Object:=wdOrganizerObjectProjectItems Next Item Template: drive.google.com/open?id=0B3t2p114NZuhYlc2N2xNb3RjZGsIngeborg

1 Answers

0
votes

It seems to be the case with all documents based on the template, om whatever computer.

I have found a solution. If I change the attached template to Normal the document's macros appear as they should.

Very strange. But nice to know.