Event: OnBeforeOpenDocument(objDialog as FileSelectionDlg)
This event gets fired whenever a document gets opened via the OpenFile or OpenURL menu command. It is sent after a document file has been selected but before the document gets opened. The file selection dialog object is initialized with the name of the selected document file. You can modify this selection. To continue the opening of the document leave the FileSelectionDlg.DialogAction property of io_objDialog at its default value spyDialogOK. To abort the opening of the document set this property to spyDialogCancel.
Given below are examples of how this event can be scripted.
XMLSpy scripting environment - VBScript:
XMLSpy scripting environment - JScript:
XMLSpy IDE Plugin:
IXMLSpyPlugIn.OnEvent (26, ...) // nEventId = 26