Windows 8 Machine (works): Microsoft Office Professional Plus 2013 Windows 10 Machine (doesn't work): Microsoft Office 365
Template (.dotm file) gets placed in Startup folder for Word. When I start Word I am presented with a blank screen. Clicking on "File" causes Word to exit immediately with no error message. The add-in has a module called MainModule and a class called WordApp. AutoExec fires up a loop which calls a dummy function.
MainModule:
'event processor class instance
Dim myWordApp As WordApp
Sub Register_Event_Handler()
Set myWordApp.appWord = Word.Application
End Sub
'gets executed automatically
Sub AutoExec()
Set myWordApp = New WordApp
Call MainProgram
End Sub
Sub MainProgram()
Register_Event_Handler
Do While True
testFunction
DoEvents
Loop
End Sub
'dummy function gets called in loop
Private Sub testFunction()
Dim i As Integer
i = 0
i = i + 1
End Sub
WordApp class:
Public WithEvents appWord As Word.Application
'fires upon closing word
Private Sub appWord_DocumentBeforeClose(ByVal Doc As Document, Cancel As
Boolean)
MsgBox "Closing"
End Sub