Code: Select all
;Although this opens microsoft word, when you create a new document or close the document, the events are not triggered.
createWordListener()
createWordListener() {
wdApp := ComObjCreate("Word.Application") ;create a word app
wdApp.Visible := true
ComObjConnect(wdApp,"wd_") ;connect to events
return
}
wd_DocumentBeforeClose(Doc, App) { ;This should trigger just before the document closes.
MsgBox, App Closing
}
wd_NewDocument(Doc,App) { ;when creating a new document, this triggers
MsgBox, New Document
}
Code: Select all
wdApp := ComObjCreate("Word.Application") ;create a word app
wdApp.Visible := true
ComObjConnect(wdApp,"wd_") ;connect to events
return
wd_DocumentBeforeClose(Doc, App) { ;This should trigger just before the document closes.
MsgBox, App Closing
}
wd_NewDocument(Doc,App) { ;when creating a new document, this triggers
MsgBox, New Document
}