如题,VBA写法如下
Public WithEvents appWord as Word.Application/Private Sub appWord_DocumentBeforeClose _
        (ByVal Doc As Document, _
        Cancel As Boolean)    Dim intResponse As Integer    intResponse = MsgBox("Do you really " _
        & "want to close the document?", _
        vbYesNo)    If intResponse = vbNo Then Cancel = True
End Sub
转为JS 应该如何写?