The issue is probably the use of Document_Open
- you have to set up the event in the template, not the document you are opening. You can also use an Auto_Open
macro. Note that ActiveDocument
may also be part of the culprit - the document you open may not yet be the actual active document when you kick the Document_Open
event - you may need to set a reference to the document you're opening like:
Dim doc As Document
set doc = Documents.Open(your path here)
doc.TablesOfContents(1).Update
Finally, your Macro Security settings could be disallowing anything from executing.
In all cases, have a good read of Take Control of Microsoft Word Through Events and Running a macro automatically when a document is created, opened or closed.