Hi Taiwo
Thanks for your lucid instructions.
Trust Centre Settings are already set to: -
Enable all macros (not recommended)
Developer Macro Settings - Trust access to the VBA project object model.
Amending the name AutoOpen to Document_Open produced the same error.
Likewise creating MyAutoOpen in a module and calling from AutoOpen
Open with is already set to Word and the Default Programs for .dotm to Microsoft Word Macro‑Enabled-template.
I have tried copying the template file and running it from other Trusted Locations without success. With regard to "AutoOpen" can conflict with certain Word features or behaviours, I was wondering if the problem had anything to do with my key binding code, but it doesn’t.
Going back to basics: -
Open a blank document and type “Test 1”
Open VBEditor and in ThisDocument, create a subroutine
Sub Document_Open()
Msgbox “Macro run at start-up”
End Sub
Save file as Test.dotm
Location e.g. C:\Users\tom\AppData\Roaming\Microsoft\Templates
Right-click Test.dotm and select open.
Message displayed “Macro run at start-up”
Close file
Double-click Test.dotm
Displays Document1 with text “Test 1” but there is no message from Message box.
Ament text “Test 1” to “Test failed”, press Ctrl+W and click Save
Open TestFailed.docx
It now runs the start-up subroutine the message box displaying “Macro run at start-up”.
I’m running the home version of 365 on a Dell Inspiron 3502 laptop allowing updates to install. There are no subroutines in the file Normal.dotm
Kind Regards
Tom